Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8ab2d56
refactor: standardize AI and editor adapter initialization
helizaga Feb 11, 2026
1aa5b20
refactor: streamline editor adapter scripts with terminal definition
helizaga Feb 11, 2026
9cd81a4
refactor: simplify get_current_branch function logic
helizaga Feb 11, 2026
06c2301
feat: add CI workflow for linting and testing
helizaga Feb 11, 2026
5368d32
fix: address CI failures and review feedback
helizaga Feb 12, 2026
25ede69
refactor: improve error handling in copy_directories function
helizaga Feb 12, 2026
98858e3
refactor: enhance current_branch function for better detection
helizaga Feb 12, 2026
e56424d
refactor: enhance adapter management and command structure
helizaga Feb 12, 2026
194212b
refactor: enhance command context handling with shellcheck directives
helizaga Feb 12, 2026
289124b
refactor: enhance testing documentation and command help
helizaga Feb 12, 2026
41c1488
refactor: enhance argument parsing and command completion
helizaga Feb 12, 2026
8a8d7be
fix: use prefix variable in doctor to resolve ShellCheck SC2034
helizaga Feb 12, 2026
847965e
refactor: enhance adapter and configuration management
helizaga Feb 12, 2026
2fcf302
fix: improve error handling in launch and command scripts
helizaga Feb 12, 2026
1a4b73a
refactor: remove unused functions and improve command clarity
helizaga Feb 12, 2026
e512a10
refactor: simplify worktree management by removing force flag handling
helizaga Feb 12, 2026
7fdcadf
refactor: update shebang and improve pattern matching in scripts
helizaga Feb 12, 2026
4e3f724
refactor: enhance testing and command structure
helizaga Feb 12, 2026
c05ca37
fix: improve directory handling and test execution in clean command
helizaga Feb 12, 2026
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
33 changes: 33 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install ShellCheck
run: sudo apt-get install -y shellcheck

Comment thread
helizaga marked this conversation as resolved.
- name: Run ShellCheck
run: |
shellcheck bin/gtr bin/git-gtr lib/*.sh adapters/editor/*.sh adapters/ai/*.sh

test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install BATS
run: sudo apt-get install -y bats

- name: Run tests
run: bats tests/
29 changes: 4 additions & 25 deletions adapters/ai/aider.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
#!/usr/bin/env bash
# Aider AI coding assistant adapter

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

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

if ! ai_can_start; then
log_error "Aider not found. Install with: pip install aider-chat"
log_info "See https://aider.chat 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 aider with any additional arguments
(cd "$path" && aider "$@")
}
_AI_CMD="aider"
_AI_ERR_MSG="Aider not found. Install with: pip install aider-chat"
_AI_INFO_LINES=("See https://aider.chat for more information")
_ai_define_standard
30 changes: 4 additions & 26 deletions adapters/ai/auggie.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
#!/usr/bin/env bash
# Auggie CLI AI adapter

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

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

if ! ai_can_start; then
log_error "Auggie CLI not found. Install with: npm install -g @augmentcode/auggie"
log_info "See https://www.augmentcode.com/product/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 auggie with any additional arguments
(cd "$path" && auggie "$@")
}

_AI_CMD="auggie"
_AI_ERR_MSG="Auggie CLI not found. Install with: npm install -g @augmentcode/auggie"
_AI_INFO_LINES=("See https://www.augmentcode.com/product/CLI for more information")
_ai_define_standard
33 changes: 7 additions & 26 deletions adapters/ai/codex.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,10 @@
#!/usr/bin/env bash
# OpenAI Codex CLI adapter

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

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

if ! ai_can_start; then
log_error "Codex CLI not found. Install with: npm install -g @openai/codex"
log_info "Or: brew install codex"
log_info "See https://github.com/openai/codex 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 codex with any additional arguments
(cd "$path" && codex "$@")
}
_AI_CMD="codex"
_AI_ERR_MSG="Codex CLI not found. Install with: npm install -g @openai/codex"
_AI_INFO_LINES=(
"Or: brew install codex"
"See https://github.com/openai/codex for more info"
)
_ai_define_standard
29 changes: 4 additions & 25 deletions adapters/ai/continue.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
#!/usr/bin/env bash
# Continue CLI adapter

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

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

if ! ai_can_start; then
log_error "Continue CLI not found. Install from https://continue.dev"
log_info "See https://docs.continue.dev/cli/install for installation"
return 1
fi

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

# Change to the directory and run cn with any additional arguments
(cd "$path" && cn "$@")
}
_AI_CMD="cn"
_AI_ERR_MSG="Continue CLI not found. Install from https://continue.dev"
_AI_INFO_LINES=("See https://docs.continue.dev/cli/install for installation")
_ai_define_standard
35 changes: 8 additions & 27 deletions adapters/ai/copilot.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
#!/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 "$@")
}
_AI_CMD="copilot"
_AI_ERR_MSG="GitHub Copilot CLI not found."
_AI_INFO_LINES=(
"Install with: npm install -g @github/copilot"
"Or: brew install copilot-cli"
"See https://github.com/github/copilot-cli for more information"
)
_ai_define_standard
33 changes: 7 additions & 26 deletions adapters/ai/gemini.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,10 @@
#!/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 "$@")
}
_AI_CMD="gemini"
_AI_ERR_MSG="Gemini CLI not found. Install with: npm install -g @google/gemini-cli"
_AI_INFO_LINES=(
"Or: brew install gemini-cli"
"See https://github.com/google-gemini/gemini-cli for more info"
)
_ai_define_standard
30 changes: 4 additions & 26 deletions adapters/ai/opencode.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
#!/usr/bin/env bash
# OpenCode adapter

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

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

if ! ai_can_start; then
log_error "OpenCode not found. Install from https://opencode.ai"
log_info "Make sure the 'opencode' CLI is available in your PATH"
return 1
fi

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

# Change to the directory and run opencode with any additional arguments
(cd "$path" && opencode "$@")
}

_AI_CMD="opencode"
_AI_ERR_MSG="OpenCode not found. Install from https://opencode.ai"
_AI_INFO_LINES=("Make sure the 'opencode' CLI is available in your PATH")
_ai_define_standard
20 changes: 3 additions & 17 deletions adapters/editor/atom.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
#!/usr/bin/env bash
# Atom editor adapter

# Check if Atom is available
editor_can_open() {
command -v atom >/dev/null 2>&1
}

# Open a directory in Atom
# Usage: editor_open path
editor_open() {
local path="$1"

if ! editor_can_open; then
log_error "Atom not found. Install from https://atom.io"
return 1
fi

atom "$path"
}
_EDITOR_CMD="atom"
_EDITOR_ERR_MSG="Atom not found. Install from https://atom.io"
_editor_define_standard
27 changes: 4 additions & 23 deletions adapters/editor/cursor.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
#!/usr/bin/env bash
# Cursor editor adapter

# Check if Cursor is available
editor_can_open() {
command -v cursor >/dev/null 2>&1
}

# Open a directory or workspace file in Cursor
# Usage: editor_open path [workspace_file]
editor_open() {
local path="$1"
local workspace="${2:-}"

if ! editor_can_open; then
log_error "Cursor not found. Install from https://cursor.com or enable the shell command."
return 1
fi

# Open workspace file if provided, otherwise open directory
if [ -n "$workspace" ] && [ -f "$workspace" ]; then
cursor "$workspace"
else
cursor "$path"
fi
}
_EDITOR_CMD="cursor"
_EDITOR_ERR_MSG="Cursor not found. Install from https://cursor.com or enable the shell command."
_EDITOR_WORKSPACE=1
_editor_define_standard
22 changes: 4 additions & 18 deletions adapters/editor/emacs.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
#!/usr/bin/env bash
# Emacs editor adapter

# Check if Emacs is available
editor_can_open() {
command -v emacs >/dev/null 2>&1
}

# Open a directory in Emacs
# Usage: editor_open path
editor_open() {
local path="$1"

if ! editor_can_open; then
log_error "Emacs not found. Install from https://www.gnu.org/software/emacs/"
return 1
fi

# Open emacs with the directory
emacs "$path" &
}
_EDITOR_CMD="emacs"
_EDITOR_ERR_MSG="Emacs not found. Install from https://www.gnu.org/software/emacs/"
_EDITOR_BACKGROUND=1
_editor_define_terminal
20 changes: 3 additions & 17 deletions adapters/editor/idea.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
#!/usr/bin/env bash
# IntelliJ IDEA editor adapter

# Check if IntelliJ IDEA is available
editor_can_open() {
command -v idea >/dev/null 2>&1
}

# Open a directory in IntelliJ IDEA
# Usage: editor_open path
editor_open() {
local path="$1"

if ! editor_can_open; then
log_error "IntelliJ IDEA 'idea' command not found. Enable shell launcher in Tools > Create Command-line Launcher"
return 1
fi

idea "$path"
}
_EDITOR_CMD="idea"
_EDITOR_ERR_MSG="IntelliJ IDEA 'idea' command not found. Enable shell launcher in Tools > Create Command-line Launcher"
_editor_define_standard
Loading
Loading