feat(cli): add --remote flag for creating features on remote repos#430
Open
feat(cli): add --remote flag for creating features on remote repos#430
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… repo support 12 tasks across 4 phases: application layer composite use case, CLI --remote flag, Web UI import trigger + server action, and feature flag default change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduce CreateFeatureFromRemoteUseCase that orchestrates ImportGitHubRepositoryUseCase and CreateFeatureUseCase for single-step remote repo feature creation. Includes two-phase support (createRecord + initializeAndSpawn) for Web UI and full execute() for CLI. Registered in DI container with string token alias for web routes. 23 unit tests cover call ordering, field passthrough, error propagation, deduplication, and two-phase methods. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…display
Wire the --remote <url> option on feat new to
CreateFeatureFromRemoteUseCase. When provided, the command clones the
GitHub repo (or reuses an existing import), then creates the feature.
A dynamic spinner displays clone progress from gh CLI stderr. Errors
from the import pipeline (auth, URL parse, clone) surface as
actionable CLI messages. All existing flags (--push, --pr, --fast,
--pending, --model, --attach, --parent) compose with --remote.
Commander.js .conflicts('repo') prevents combining --remote and
--repo.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change githubImport feature flag default from false to true in TypeSpec model, settings defaults factory, and feature-flags.ts fallback. Existing users with explicit false setting are unaffected due to DB-primary resolution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Import from GitHub button in RepositoryCombobox that opens the existing GitHubImportDialog. Create createFeatureFromRemote server action with two-phase execution. Auto-select newly imported repo in combobox on successful import. Add Storybook stories and unit tests for modified components. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reformat spec.yaml with consistent YAML block scalar style and add feature.yaml to track implementation progress (12/12 tasks complete, all phases from analyze through phase-4 completed). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
9 tasks
arielshad
added a commit
that referenced
this pull request
Apr 6, 2026
) ## Summary Adds three related capabilities for working with remote GitHub repositories, unifying the work from PRs #409, #430, and #434 into a single feature on current main: - **`shep repo init-remote [name]`** — creates a GitHub repository from a local one with no remote (via `gh repo create --source=. --remote=origin --push`) - **`shep feat new --remote <url>`** — clones (or auto-forks) a GitHub repo then creates a feature on it, conflicts with `--repo` - **Web UI** — shows a "Fork" badge on forked repositories in the repo picker; `githubImport` feature flag now defaults to `true` ## Key changes ### Domain - `Repository` entity gains `isFork?: boolean` and `upstreamUrl?: string` (TypeSpec + generated output) - Migration `055-add-repository-fork-fields` adds `is_fork` and `upstream_url` columns + `idx_repositories_upstream_url` index (idempotent) ### Auto-fork detection - `IGitHubRepositoryService` gains `getAuthenticatedUser()`, `checkPushAccess()`, `forkRepository()` + `GitHubForkError` - `ImportGitHubRepositoryUseCase` now checks push access before cloning. When the user lacks write permission, it forks via `gh repo fork`, clones the fork, sets `upstream` remote, and persists fork metadata - `IRepositoryRepository.findByUpstreamUrl()` for fork deduplication ### Init remote - `IGitPrService` gains `createGitHubRepo()`, `addRemote()` + `REMOTE_ALREADY_EXISTS`, `REPO_CREATE_FAILED` error codes - New `InitRemoteRepositoryUseCase` guards against existing remotes and delegates to `gh repo create` ### Feature creation from remote - New `CreateFeatureFromRemoteUseCase` — composite that chains import → create feature - Two-phase API: `execute()` for CLI, `createRecord()` + `initializeAndSpawn()` for Web (fast optimistic UI) ### i18n - New translation keys for `repo.initRemote.*` and `feat.new.{remoteOption,remoteConflict,forkedInfo}` added to all 8 locales ## Test plan - [x] `pnpm typecheck` — zero errors - [x] `pnpm lint:fix` — clean - [x] `pnpm test:unit` — **388 files, 5585 tests passing** (includes 44 new tests) - [x] `pnpm test:int` — **50 files, 595 tests passing** (migration 055 runs cleanly) - [x] `pnpm build` — clean CLI build - [x] `pnpm build:storybook` — clean storybook build with new `WithForkBadges` story - [ ] Manual: `shep repo init-remote my-test-repo` on a fresh local repo - [ ] Manual: `shep feat new --remote https://github.com/someone/public-repo "test feature"` (triggers auto-fork path) - [ ] Manual: Web UI — import a repo you don't have push access to, verify "Fork" badge appears ## Notes - Complementary to existing `IGitForkService` (PR #525, merged) which handles fork-and-PR **within** worktrees. The new fork methods on `IGitHubRepositoryService` handle auto-fork at **import time** — these are different code paths and do not conflict. - Migration 055 uses the umzug `MigrationParams` signature with idempotent column/index checks, consistent with migration 054. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
blackpc
pushed a commit
that referenced
this pull request
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
shep feat new --remote <url>to clone, register, and create a feature on a remote GitHub repo in a single command — accepts HTTPS, SSH, andowner/reposhorthand formatsCreateFeatureFromRemoteUseCasecomposite use case in the application layer to orchestrate import-then-create flow, reusable across CLI/Web/TUIGitHubImportDialogfor inline import during feature creationgithubImportfeature flag by default so the import UI is available out of the boxcreateFeatureFromRemotefor Web UI remote feature creationWhat Changed
Application Layer
CreateFeatureFromRemoteUseCase— new composite use case that chainsImportGitHubRepositoryUseCase→CreateFeatureUseCasewith progress callbacks, deduplication (skips clone if repo already imported), and full error propagationCLI
feat/new.command.ts— added--remote <url>option with mutual exclusivity validation against--repo, clone progress display, and interactive mode support (prompt for description after import)Web UI
feature-create-drawer.tsx— integrated GitHub import trigger into theRepositoryComboboxwith auto-select on successful importcreate-feature-from-remote.ts(server action) — new action wiring remote URL to the composite use casefeature-flags.ts— changedgithubImportdefault fromfalsetotrueSpecs
Tests (1,043 new lines)
CreateFeatureFromRemoteUseCase(orchestration, deduplication, error handling)--remoteflag (validation, progress display, interactive mode)Test plan
shep feat new --remote owner/repo "description"clones and creates featureshep feat new --remotewith already-imported repo skips clone🤖 Generated with Claude Code