Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Libraries are sourced in the order listed above (ui → args → config → ...

Most adapters are defined declaratively in the **adapter registry** (`lib/adapters.sh`) using pipe-delimited entries. Custom adapters that need special logic remain as override files in `adapters/editor/` and `adapters/ai/`.

**Registry-defined adapters**: atom, cursor, emacs, idea, nvim, pycharm, sublime, vim, vscode, webstorm, zed (editors) and aider, auggie, codex, continue, copilot, gemini, opencode (AI).
**Registry-defined adapters**: antigravity, atom, cursor, emacs, idea, nvim, pycharm, sublime, vim, vscode, webstorm, zed (editors) and aider, auggie, codex, continue, copilot, gemini, opencode (AI).

**Custom adapter files**: `adapters/editor/nano.sh`, `adapters/ai/claude.sh`, `adapters/ai/cursor.sh` — these implement `editor_can_open()`/`editor_open()` or `ai_can_start()`/`ai_start()` directly.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ While `git worktree` is powerful, it's verbose and manual. `git gtr` adds qualit
- **Simple commands** - Create and manage worktrees with intuitive CLI
- **Repository-scoped** - Each repo has independent worktrees
- **Configuration over flags** - Set defaults once, use simple commands
- **Editor integration** - Open worktrees in Cursor, VS Code, Zed, and more
- **Editor integration** - Open worktrees in Antigravity, Cursor, VS Code, Zed, and more
- **AI tool support** - Launch Aider, Claude Code, or other AI coding tools
- **Smart file copying** - Selectively copy configs/env files to new worktrees
- **Hooks system** - Run custom commands after create/remove
Expand Down Expand Up @@ -323,7 +323,7 @@ All configuration is stored via `git config`. For team settings, create a `.gtrc
### Quick Setup

```bash
# Set your editor (cursor, vscode, zed)
# Set your editor (antigravity, cursor, vscode, zed)
git gtr config set gtr.editor.default cursor

# Set your AI tool (aider, auggie, claude, codex, continue, copilot, cursor, gemini, opencode)
Expand Down
2 changes: 1 addition & 1 deletion completions/_git-gtr
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ _git-gtr() {
elif (( CURRENT >= 5 )); then
case "$words[3]" in
editor)
_arguments '--editor[Editor to use]:editor:(atom cursor emacs idea nano none nvim pycharm sublime vim vscode webstorm zed)'
_arguments '--editor[Editor to use]:editor:(antigravity atom cursor emacs idea nano none nvim pycharm sublime vim vscode webstorm zed)'
;;
ai)
_arguments '--ai[AI tool to use]:tool:(aider auggie claude codex continue copilot cursor gemini none opencode)'
Expand Down
2 changes: 1 addition & 1 deletion completions/git-gtr.fish
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ complete -c git -n '__fish_git_gtr_using_command list' -l porcelain -d 'Machine-
complete -c git -n '__fish_git_gtr_using_command ls' -l porcelain -d 'Machine-readable output'

# Editor command options
complete -c git -n '__fish_git_gtr_using_command editor' -l editor -d 'Editor to use' -r -a 'atom cursor emacs idea nano none nvim pycharm sublime vim vscode webstorm zed'
complete -c git -n '__fish_git_gtr_using_command editor' -l editor -d 'Editor to use' -r -a 'antigravity atom cursor emacs idea nano none nvim pycharm sublime vim vscode webstorm zed'

# AI command options
complete -c git -n '__fish_git_gtr_using_command ai' -l ai -d 'AI tool to use' -r -a 'aider auggie claude codex continue copilot cursor gemini none opencode'
Expand Down
2 changes: 1 addition & 1 deletion completions/gtr.bash
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ _git_gtr() {
if [[ "$cur" == -* ]]; then
COMPREPLY=($(compgen -W "--editor" -- "$cur"))
elif [ "$prev" = "--editor" ]; then
COMPREPLY=($(compgen -W "atom cursor emacs idea nano none nvim pycharm sublime vim vscode webstorm zed" -- "$cur"))
COMPREPLY=($(compgen -W "antigravity atom cursor emacs idea nano none nvim pycharm sublime vim vscode webstorm zed" -- "$cur"))
else
local branches all_options
branches=$(git branch --format='%(refname:short)' 2>/dev/null || true)
Expand Down
7 changes: 4 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ git gtr config set gtr.provider github
## Editor Settings

```bash
# Default editor: cursor, vscode, zed, or none
# Default editor: antigravity, cursor, vscode, zed, or none
gtr.editor.default = cursor

# Workspace file for VS Code/Cursor (relative path from worktree root)
# Workspace file for VS Code/Cursor/Antigravity (relative path from worktree root)
# If set, opens the workspace file instead of the folder
# If not set, auto-detects *.code-workspace files in worktree root
# Set to "none" to disable workspace lookup entirely
Expand All @@ -146,13 +146,14 @@ gtr.editor.workspace = project.code-workspace

**Setup editors:**

- **Antigravity**: Install from [antigravity.google](https://antigravity.google), `agy` command available after installation
- **Cursor**: Install from [cursor.com](https://cursor.com), enable shell command
- **VS Code**: Install from [code.visualstudio.com](https://code.visualstudio.com), enable `code` command
- **Zed**: Install from [zed.dev](https://zed.dev), `zed` command available automatically

**Workspace files:**

VS Code and Cursor support `.code-workspace` files for multi-root workspaces, custom settings, and recommended extensions. When opening a worktree:
VS Code, Cursor, and Antigravity support `.code-workspace` files for multi-root workspaces, custom settings, and recommended extensions. When opening a worktree:

1. If `gtr.editor.workspace` is set to a path, opens that file (relative to worktree root)
2. If set to `none`, disables workspace lookup (always opens folder)
Expand Down
3 changes: 2 additions & 1 deletion lib/adapters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#
# Loading: file override (adapters/editor/<name>.sh) → registry → generic PATH fallback
_EDITOR_REGISTRY="
antigravity|agy|standard|Antigravity 'agy' command not found. Install from https://antigravity.google|workspace
Comment thread
helizaga marked this conversation as resolved.
atom|atom|standard|Atom not found. Install from https://atom.io|
cursor|cursor|standard|Cursor not found. Install from https://cursor.com or enable the shell command.|workspace
emacs|emacs|terminal|Emacs not found. Install from https://www.gnu.org/software/emacs/|background
Expand Down Expand Up @@ -252,7 +253,7 @@ _editor_define_terminal() {
}
}

# Resolve workspace file for VS Code/Cursor editors
# Resolve workspace file for VS Code/Cursor/Antigravity editors
# Returns the workspace file path if found, empty otherwise
resolve_workspace_file() {
local worktree_path="$1"
Expand Down
12 changes: 6 additions & 6 deletions lib/commands/help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ Special:
Use '1' to open the main repo root: git gtr editor 1

Available editors:
atom, cursor, emacs, idea, nano, nvim, pycharm, sublime, vim, vscode,
webstorm, zed, none (or any command in your PATH)
antigravity, atom, cursor, emacs, idea, nano, nvim, pycharm, sublime, vim,
vscode, webstorm, zed, none (or any command in your PATH)

Examples:
git gtr editor my-feature # Uses default editor
Expand Down Expand Up @@ -593,10 +593,10 @@ CONFIGURATION OPTIONS:
gtr.worktrees.prefix Worktree folder prefix (default: "")
gtr.defaultBranch Default branch (default: auto)
gtr.editor.default Default editor
Options: cursor, vscode, zed, idea, pycharm,
webstorm, vim, nvim, emacs, sublime, nano,
atom, none
gtr.editor.workspace Workspace file for VS Code/Cursor
Options: antigravity, atom, cursor, emacs,
idea, nano, nvim, pycharm, sublime, vim,
vscode, webstorm, zed, none
gtr.editor.workspace Workspace file for VS Code/Cursor/Antigravity
(relative path, auto-detects, or "none")
gtr.ai.default Default AI tool
Options: aider, auggie, claude, codex, continue,
Expand Down
1 change: 1 addition & 0 deletions scripts/generate-completions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ MIDDLE2
gtr.hook.preRemove) desc="Pre-remove hook (abort on failure)" ;;
gtr.hook.postRemove) desc="Post-remove hook" ;;
gtr.hook.postCd) desc="Post-cd hook (shell integration only)" ;;
gtr.ui.color) desc="Color output mode (auto, always, never)" ;;
*) desc="$key" ;;
esac
printf " %s\t'%s'\n" "$key" "$desc"
Expand Down