Skip to content

refactor(factory): remove gh dependency from finish command #76

@duizendstra

Description

@duizendstra

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:

  1. Pushes the branch: Ensures the local branch is pushed to the remote repository.
  2. 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.
  3. 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 finish command no longer executes or depends on the gh CLI.
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions