Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ gtr.editor.default = cursor
### AI Tool Settings

```bash
# Default AI tool: none (or aider, claude, codex, cursor, continue, opencode)
# Default AI tool: none (or aider, claude, codex, continue, cursor, gemini, opencode)
gtr.ai.default = none
```

Expand All @@ -333,8 +333,9 @@ gtr.ai.default = none
| **[Aider](https://aider.chat)** | `pip install aider-chat` | Pair programming, edit files with AI | `git gtr config set gtr.ai.default aider` |
| **[Claude Code](https://claude.com/claude-code)** | Install from claude.com | Terminal-native coding agent | `git gtr config set gtr.ai.default claude` |
| **[Codex CLI](https://github.com/openai/codex)** | `npm install -g @openai/codex` | OpenAI coding assistant | `git gtr config set gtr.ai.default codex` |
| **[Cursor](https://cursor.com)** | Install from cursor.com | AI-powered editor with CLI agent | `git gtr config set gtr.ai.default cursor` |
| **[Continue](https://continue.dev)** | See [docs](https://docs.continue.dev/cli/install) | Open-source coding agent | `git gtr config set gtr.ai.default continue` |
| **[Cursor](https://cursor.com)** | Install from cursor.com | AI-powered editor with CLI agent | `git gtr config set gtr.ai.default cursor` |
| **[Gemini](https://github.com/google-gemini/gemini-cli)** | `npm install -g @google/gemini-cli` | Open-source AI coding assistant powered by Google Gemini | `git gtr config set gtr.ai.default gemini` |
| **[OpenCode](https://opencode.ai)** | Install from opencode.ai | AI coding assistant | `git gtr config set gtr.ai.default opencode` |

**Examples:**
Expand Down
29 changes: 29 additions & 0 deletions adapters/ai/gemini.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Gemini CLI adapter

# Check if Gemini is available
ai_can_start() {
command -v gemini >/dev/null 2>&1
}

# Start Gemini in a directory
# Usage: ai_start path [args...]
ai_start() {
local path="$1"
shift

if ! ai_can_start; then
log_error "Gemini CLI not found. Install with: npm install -g @google/gemini-cli"
log_info "Or: brew install gemini-cli"
log_info "See https://github.com/google-gemini/gemini-cli for more info"
return 1
fi

if [ ! -d "$path" ]; then
log_error "Directory not found: $path"
return 1
fi

# Change to the directory and run gemini with any additional arguments
(cd "$path" && gemini "$@")
}
6 changes: 3 additions & 3 deletions bin/gtr
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ load_ai_adapter() {

if ! command -v "$cmd_name" >/dev/null 2>&1; then
log_error "AI tool '$ai_tool' not found"
log_info "Built-in adapters: aider, claude, codex, cursor, continue, opencode"
log_info "Built-in adapters: aider, claude, codex, continue, cursor, gemini, opencode"
log_info "Or use any AI tool command available in your PATH (e.g., bunx, gpt)"
exit 1
fi
Expand Down Expand Up @@ -1124,8 +1124,8 @@ CONFIGURATION OPTIONS:
webstorm, vim, nvim, emacs, sublime, nano,
atom, none
gtr.ai.default Default AI tool
Options: aider, claude, codex, cursor,
continue, opencode, none
Options: aider, claude, codex, continue,
cursor, gemini, opencode, none
gtr.copy.include Files to copy (multi-valued)
gtr.copy.exclude Files to exclude (multi-valued)
gtr.copy.includeDirs Directories to copy (multi-valued)
Expand Down
2 changes: 1 addition & 1 deletion completions/_git-gtr
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ _git-gtr() {
_arguments '--editor[Editor to use]:editor:(cursor vscode zed idea pycharm webstorm vim nvim emacs sublime nano atom none)'
;;
ai)
_arguments '--ai[AI tool to use]:tool:(aider claude codex cursor continue opencode none)'
_arguments '--ai[AI tool to use]:tool:(aider claude codex continue cursor gemini opencode none)'
Copy link

@coderabbitai coderabbitai bot Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

LGTM! Verify all three completion files were updated.

The addition of gemini to the AI tool list is correct and maintains alphabetical ordering. However, per coding guidelines, all three completion files (gtr.bash, _git-gtr, gtr.fish) must be updated when adding new AI adapters.

As per coding guidelines, verify that gtr.bash and gtr.fish were also updated with the gemini adapter:


🏁 Script executed:

#!/bin/bash
# Description: Verify that all three completion files include gemini in their AI tool lists

echo "=== Checking gtr.bash ==="
rg -n "gemini" completions/gtr.bash

echo ""
echo "=== Checking _git-gtr ==="
rg -n "gemini" completions/_git-gtr

echo ""
echo "=== Checking gtr.fish ==="
rg -n "gemini" completions/gtr.fish

Length of output: 187


Update gtr.bash and gtr.fish to include the gemini AI adapter.

Verification confirms that gemini was added to _git-gtr (line 88) but is missing from gtr.bash and gtr.fish. Per coding guidelines, all three completion files must be updated when adding new AI adapters. Both files require the gemini entry in their AI tool lists.

🤖 Prompt for AI Agents
In completions/gtr.bash and completions/gtr.fish (update the AI tool lists
corresponding to the change at completions/_git-gtr line 88), the AI adapter
"gemini" is missing; add "gemini" to the AI tool choice arrays/strings in both
files so their lists match _git-gtr, ensuring the new adapter appears in bash
and fish completions as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai
Currently, AI tool list completion (for the --ai flag) is only implemented in _git-gtr
(Zsh). gtr.bash and gtr.fish do not yet have the logic to complete AI tool names.

If we want to support this in gtr.bash and gtr.fish, I would need to implement the
completion logic itself first. Should I include that implementation in this PR?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the current state of AI tool completion in gtr.bash and gtr.fish

echo "=== Checking gtr.bash for --ai completion logic ==="
if [ -f completions/gtr.bash ]; then
  rg -n -C5 "ai.*tool|--ai" completions/gtr.bash || echo "No --ai completion logic found"
else
  echo "File not found"
fi

echo ""
echo "=== Checking gtr.fish for --ai completion logic ==="
if [ -f completions/gtr.fish ]; then
  rg -n -C5 "ai.*tool|--ai" completions/gtr.fish || echo "No --ai completion logic found"
else
  echo "File not found"
fi

echo ""
echo "=== Checking _git-gtr for --ai completion logic ==="
rg -n -C3 "--ai" completions/_git-gtr

Length of output: 2129


🏁 Script executed:

#!/bin/bash
# Corrected script to check for --ai completion logic

echo "=== Checking _git-gtr for --ai completion logic ==="
rg -n -C3 '\-\-ai' completions/_git-gtr

echo ""
echo "=== Checking gtr.bash for editor completion (for comparison) ==="
rg -n -C3 '\-\-editor' completions/gtr.bash || echo "No --editor completion found"

echo ""
echo "=== Checking gtr.fish for editor completion (for comparison) ==="
rg -n -C3 '\-\-editor' completions/gtr.fish || echo "No --editor completion found"

Length of output: 562


@tsuno08, thank you for the clarification! You're absolutely right—I've confirmed that gtr.bash and gtr.fish do not currently have any flag completion logic for --ai (or even --editor). Only _git-gtr (Zsh) has this functionality.

Recommendation: Keep this PR focused on adding the gemini adapter. Implementing completion logic for --ai and --editor flags in gtr.bash and gtr.fish would be a separate feature enhancement and would expand the scope significantly.

Your current changes are correct—you've properly updated _git-gtr, which is the only completion file that currently supports AI tool name completion.

Suggested follow-up: If you'd like to add this completion support to bash and fish shells, that would make a great follow-up PR or issue. Would you like me to create an issue to track this enhancement?

🐰💭

   (\(\
   ( -.-)
   o_(")(")
   [noted!]

⛔ Learnings removed
Learnt from: CR
Repo: coderabbitai/git-worktree-runner PR: 0
File: .github/instructions/completions.instructions.md:0-0
Timestamp: 2025-11-24T19:17:16.865Z
Learning: Applies to completions/{gtr.bash,_git-gtr,gtr.fish} : Implement adapter name completion in all three completion files, listing available editor names (cursor, vscode, zed) and AI tool names (aider, claude, codex) for --editor and --ai flags

🧠 Learnings used
Learnt from: CR
Repo: coderabbitai/git-worktree-runner PR: 0
File: .github/instructions/completions.instructions.md:0-0
Timestamp: 2025-11-24T19:17:16.865Z
Learning: Applies to completions/{gtr.bash,_git-gtr,gtr.fish} : Implement adapter name completion in all three completion files, listing available editor names (cursor, vscode, zed) and AI tool names (aider, claude, codex) for --editor and --ai flags

;;
rm)
_arguments \
Expand Down