From 843dd1fab38f269d13b0425b257a20998a87a9f6 Mon Sep 17 00:00:00 2001 From: tsuno08 Date: Sat, 22 Nov 2025 22:48:31 +0900 Subject: [PATCH 1/2] feat: add gemini adapter --- README.md | 3 ++- adapters/ai/gemini.sh | 29 +++++++++++++++++++++++++++++ bin/gtr | 4 ++-- completions/_git-gtr | 2 +- 4 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 adapters/ai/gemini.sh diff --git a/README.md b/README.md index 5485017..409c6bf 100644 --- a/README.md +++ b/README.md @@ -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, cursor, continue, gemini, opencode) gtr.ai.default = none ``` @@ -335,6 +335,7 @@ gtr.ai.default = none | **[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` | +| **[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:** diff --git a/adapters/ai/gemini.sh b/adapters/ai/gemini.sh new file mode 100644 index 0000000..2a4d017 --- /dev/null +++ b/adapters/ai/gemini.sh @@ -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 "$@") +} \ No newline at end of file diff --git a/bin/gtr b/bin/gtr index a1b1022..8764e30 100755 --- a/bin/gtr +++ b/bin/gtr @@ -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, cursor, continue, gemini, opencode" log_info "Or use any AI tool command available in your PATH (e.g., bunx, gpt)" exit 1 fi @@ -1125,7 +1125,7 @@ CONFIGURATION OPTIONS: atom, none gtr.ai.default Default AI tool Options: aider, claude, codex, cursor, - continue, opencode, none + continue, 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) diff --git a/completions/_git-gtr b/completions/_git-gtr index 67072cb..3a0d5e7 100644 --- a/completions/_git-gtr +++ b/completions/_git-gtr @@ -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 cursor continue gemini opencode none)' ;; rm) _arguments \ From e53b28a67feb10ed3aa86d1b9ae0c94acb3f5db5 Mon Sep 17 00:00:00 2001 From: tsuno08 Date: Sat, 22 Nov 2025 22:58:54 +0900 Subject: [PATCH 2/2] docs: reorder AI adapters alphabetically --- README.md | 4 ++-- bin/gtr | 6 +++--- completions/_git-gtr | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 409c6bf..ce8518b 100644 --- a/README.md +++ b/README.md @@ -322,7 +322,7 @@ gtr.editor.default = cursor ### AI Tool Settings ```bash -# Default AI tool: none (or aider, claude, codex, cursor, continue, gemini, opencode) +# Default AI tool: none (or aider, claude, codex, continue, cursor, gemini, opencode) gtr.ai.default = none ``` @@ -333,8 +333,8 @@ 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` | diff --git a/bin/gtr b/bin/gtr index 8764e30..cc3de6f 100755 --- a/bin/gtr +++ b/bin/gtr @@ -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, gemini, 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 @@ -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, gemini, 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) diff --git a/completions/_git-gtr b/completions/_git-gtr index 3a0d5e7..3217236 100644 --- a/completions/_git-gtr +++ b/completions/_git-gtr @@ -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 gemini opencode none)' + _arguments '--ai[AI tool to use]:tool:(aider claude codex continue cursor gemini opencode none)' ;; rm) _arguments \