feat(cli): add init-remote command for github repository creation#409
Open
feat(cli): add init-remote command for github repository creation#409
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… remote init Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ervice Extend IGitPrService interface with createGitHubRepo() and addRemote() method signatures for GitHub remote initialization. Add REMOTE_ALREADY_EXISTS and REPO_CREATE_FAILED to GitPrErrorCode enum. Add stub implementations in GitPrService and update all test mocks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…o git-pr service Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements InitRemoteRepositoryUseCase that orchestrates the full flow: validates gh CLI availability via IToolInstallerService, guards against existing remotes, derives repo name from cwd basename, and delegates to IGitPrService.createGitHubRepo() for atomic create+remote+push. Includes comprehensive unit tests covering happy path, gh not installed, remote already exists, error propagation, custom name, org support, public/private visibility, and Windows path handling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
493a883 to
5bdd852
Compare
Add createGitHubRepo and addRemote mock methods to IGitPrService mock to satisfy the interface contract after new methods were added. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Add a new
shep repo init-remoteCLI command that creates a GitHub repository viagh repo createand configures the local git remote for repositories that don't yet have one. This bridges the gap between local-only repos and GitHub-dependent shep workflows (PRs, CI, push).Changes across Clean Architecture layers:
IGitPrServicewithcreateGitHubRepo()andaddRemote()methods; added newGitPrErrorCodevalues (GH_NOT_FOUND,AUTH_FAILURE,REPO_CREATE_FAILED)GitPrServiceusinggh repo createandgit remote addsubprocess calls with the existingExecFunctioninjection patternInitRemoteRepositoryUseCaseorchestrating the full flow — validate gh CLI availability, checkhasRemote()guard, create repo, add remote, auto-push current branchinit-remotesubcommand underrepocommand group with[name]positional arg,--publicflag, and--org <name>optionEvidence
Test plan
addRemote()(correct args, void return, error wrapping)createGitHubRepo()(private/public/org, URL return, ENOENT→GH_NOT_FOUND, auth→AUTH_FAILURE, generic→REPO_CREATE_FAILED)InitRemoteRepositoryUseCase(happy path, guards, error propagation, name derivation, org support, visibility, Windows paths, actionable messages)🤖 Generated with Claude Code