-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Summary
After running git gtr new <branch>, the tool displays helpful "Next steps" suggesting commands to open an editor or start an AI tool:
Next steps:
git gtr editor MyBranch # Open in editor
git gtr ai MyBranch # Start AI tool
cd "$(git gtr go MyBranch)" # Navigate to worktree
It would be convenient to have flags that automatically perform these actions, avoiding the need to copy/paste a second command.
Proposed Solution
Add optional flags to git gtr new:
--editoror-e: Automatically open the configured editor after worktree creation--aior-a: Automatically start the configured AI tool after worktree creation
Example usage
# Create worktree and immediately open in editor
git gtr new my-feature --editor
# Create worktree and start AI tool
git gtr new my-feature --ai
# Both could potentially be combined
git gtr new my-feature --editor --ai--cd flag
Wanted to also suggest adding a --cd flag to change directory, but I think this is tricky since a subprocess can't change the parent shell's directory.
Benefits
- Faster workflow - Common two-step actions become single commands
- Scriptable - Easier to automate worktree creation with immediate editor/AI startup
- Consistent with existing patterns - Similar to how
git clonehas--branchto do extra work
Questions for maintainers
- Does this align with the project's philosophy of "configuration over flags"?
- Should these be position-independent flags or positional options?
- Any concerns about flag naming conflicts?
Happy to implement this if the approach is approved!
Metadata
Metadata
Assignees
Labels
No labels