-
Notifications
You must be signed in to change notification settings - Fork 1
refactor(factory): remove gh dependency from finish command #76
Description
Summary
This issue tracks the work to refactor the contextvibes factory finish command to remove its dependency on the GitHub CLI (gh). This is a direct consequence of the decision to simplify our toolchain by removing gh from the standard development environment (as part of issue #9).
Problem Statement
The gh CLI has been removed from the .idx/dev.nix environment. The contextvibes factory finish command currently relies on gh to open an interactive prompt for creating a pull request. This dependency now causes the command to fail.
We need to re-implement the final step of this command so that it provides a seamless user experience without requiring an external CLI tool.
Proposed Solution
The finish command's core logic (pushing the branch) should remain. The final, interactive step should be replaced with a new implementation that:
- Pushes the branch: Ensures the local branch is pushed to the remote repository.
- Constructs a PR URL: Programmatically determines the correct URL for creating a pull request on GitHub for the current branch. This can be done by inspecting the git remote URL and the current branch name.
- Prints the URL: Displays the generated, clickable URL to the user in the terminal. This allows the user to simply click the link to open the "Create Pull Request" page in their browser, completing the workflow.
Example User Experience
$ contextvibes factory finish
> Branch 'feature/example' is up to date with the remote.
>
> ✅ Your branch is ready for a pull request.
>
> Create your pull request by visiting this URL:
> https://github.com/your-org/your-repo/pull/new/feature/example
Acceptance Criteria
- The
contextvibes factory finishcommand no longer executes or depends on theghCLI. - The command successfully pushes the current local branch to the remote if it is ahead.
- After a successful push, the command prints a valid, clickable URL to the terminal that opens the "Create Pull Request" page on GitHub.
- The command exits with a status code of 0 on success.
Context
- CLI Version:
dev - OS/Arch:
linux/amd64 - Filed by: @duizendstra