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
30 changes: 30 additions & 0 deletions adapters/ai/copilot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# GitHub Copilot CLI adapter

# Check if GitHub Copilot CLI is available
ai_can_start() {
command -v copilot >/dev/null 2>&1
}

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

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

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

# Change to the directory and run copilot with any additional arguments
(cd "$path" && copilot "$@")
}
4 changes: 2 additions & 2 deletions bin/gtr
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,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, continue, cursor, gemini, opencode"
log_info "Built-in adapters: aider, claude, codex, continue, copilot, 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 @@ -1293,7 +1293,7 @@ CONFIGURATION OPTIONS:
atom, none
gtr.ai.default Default AI tool
Options: aider, claude, codex, continue,
cursor, gemini, opencode, none
copilot, 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 @@ -86,7 +86,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 continue cursor gemini opencode none)'
_arguments '--ai[AI tool to use]:tool:(aider claude codex continue copilot cursor gemini opencode none)'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Missing completion updates for bash and fish shells.

The coding guidelines explicitly require updating all three completion files when adding adapters. This PR only updates the Zsh completion file (_git-gtr), but the Bash (completions/gtr.bash) and Fish (completions/gtr.fish) completion files also need to include copilot in their AI tool lists.

As per coding guidelines: "Always update all three completion files (gtr.bash, _git-gtr, gtr.fish) when adding new commands, flags, editors, or AI adapters"

Please add copilot to the AI tool completions in:

  • completions/gtr.bash
  • completions/gtr.fish
🤖 Prompt for AI Agents
In completions/gtr.bash and completions/gtr.fish (additions related to the AI
tools list for shell completions), the Bash and Fish completion files are
missing the new "copilot" AI adapter that was added to the Zsh file at
completions/_git-gtr line 89; update each file's AI tool list to include
"copilot" in the same position/format as the other tools (e.g., add copilot to
the comma/space-separated list or array of AI tools used for completion), save
and run the shell completion generation or lint to verify the entries match the
Zsh completion.

;;
rm)
_arguments \
Expand Down