Skip to content

Commit 79a6e7e

Browse files
committed
Add support for Goose AI coding agent
- Add goose to supported_commands list in get_installed_agents() - Add goose flag handling (returns empty string, no bypass flags needed) - Implement stdin prompt handling for goose in both single and multi-agent modes - Update help text and error messages to include goose - Update cleanup logic to handle goose branches - Update README.md with Goose documentation and examples Fixes #25 Signed-off-by: Lars Trieloff <lars@trieloff.net>
1 parent 1fcd689 commit 79a6e7e

2 files changed

Lines changed: 46 additions & 9 deletions

File tree

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ yolo -w
9797
yolo --dry-run
9898
```
9999

100-
When you run `yolo` without specifying a command, it scans your system for all installed supported coding agents (codex, claude, copilot, droid, amp, cursor-agent, opencode, gemini, qwen, kimi, crush) and picks one at random. You only live yolo - even choosing your AI assistant is too much commitment!
100+
When you run `yolo` without specifying a command, it scans your system for all installed supported coding agents (codex, claude, copilot, droid, amp, cursor-agent, opencode, gemini, qwen, kimi, crush, aider, goose) and picks one at random. You only live yolo - even choosing your AI assistant is too much commitment!
101101

102102
### Basic Usage
103103

@@ -223,6 +223,7 @@ Use `--mop` to clean up orphaned worktrees from interrupted sessions or when you
223223
| `qwen` | `--yolo` (+ `-i` when prompt present) |
224224
| `kimi` | `--yolo` (+ `--command` when prompt present) |
225225
| `crush` | `--yolo` (+ Ghostty injection when prompt present) |
226+
| `goose` | *(no flags - prompts passed via stdin)* |
226227
| *(other)* | `--yolo` |
227228

228229
### Examples
@@ -244,6 +245,13 @@ yolo claude
244245
yolo claude "fix all the bugs"
245246
yolo codex --help
246247

248+
# Goose examples
249+
yolo goose "analyze the codebase and suggest improvements"
250+
yolo -w goose "implement feature X" # Create worktree for goose session
251+
yolo -e goose # Compose complex prompt in editor for goose
252+
yolo -w -c goose "quick experiment" # Create worktree, auto-cleanup after
253+
yolo -w -nc goose "keep this work" # Create worktree, preserve it after
254+
247255
# Editor mode
248256
yolo -e claude # Compose prompt in editor
249257
yolo -e codex,claude,gemini # Editor prompt for multi-agent
@@ -293,7 +301,7 @@ When you run `yolo` without specifying a command:
293301
yolo
294302

295303
# YOLO does:
296-
# 1. Scans PATH for installed agents (codex, claude, copilot, droid, amp, cursor-agent, opencode, gemini, qwen, kimi, crush)
304+
# 1. Scans PATH for installed agents (codex, claude, copilot, droid, amp, cursor-agent, opencode, gemini, qwen, kimi, crush, aider, goose)
297305
# 2. Picks one at random using $RANDOM
298306
# 3. Adds appropriate flags for that agent
299307
# 4. Launches it
@@ -557,6 +565,8 @@ YOLO works with the following AI coding assistants:
557565
| **Gemini** | [github.com/google-gemini/gemini-cli](https://github.com/google-gemini/gemini-cli) | Google's open-source AI agent with Gemini 2.5 Pro |
558566
| **Kimi** | [kimi.moonshot.cn](https://kimi.moonshot.cn) | Moonshot AI's coding assistant with advanced reasoning |
559567
| **Crush** | [charm.sh/crush](https://charm.sh/crush) | Charm's interactive CLI tool for software engineering tasks |
568+
| **Aider** | [github.com/paul-gauthier/aider](https://github.com/paul-gauthier/aider) | AI pair programmer in your terminal |
569+
| **Goose** | [github.com/block/goose](https://github.com/block/goose) | Block's open-source AI coding agent (Square, Cash App, Afterpay) |
560570

561571
## Related Projects
562572

executable_yolo

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Supported Commands:
104104
opencode No extra flags added
105105
crush Uses --yolo (requires Ghostty for interactive prompts)
106106
aider Uses --yes-always (requires Ghostty for interactive prompts)
107+
goose No extra flags added (prompts passed via stdin)
107108
<other> Adds --yolo (generic fallback)
108109
109110
Multi-agent Mode:
@@ -300,6 +301,11 @@ get_command_flags() {
300301
# aider uses --yes-always for auto-approval
301302
echo "--yes-always"
302303
;;
304+
goose)
305+
# Goose has no bypass flags - runs autonomously by default
306+
# Prompts are passed via stdin, not command-line flags
307+
echo ""
308+
;;
303309
*)
304310
echo "--yolo"
305311
;;
@@ -314,7 +320,7 @@ command_exists() {
314320
# Get all installed supported coding agents
315321
get_installed_agents() {
316322
local agents=()
317-
local supported_commands=("codex" "claude" "copilot" "droid" "amp" "cursor-agent" "opencode" "qwen" "gemini" "kimi" "crush" "aider")
323+
local supported_commands=("codex" "claude" "copilot" "droid" "amp" "cursor-agent" "opencode" "qwen" "gemini" "kimi" "crush" "aider" "goose")
318324

319325
for cmd in "${supported_commands[@]}"; do
320326
if command_exists "$cmd"; then
@@ -465,8 +471,8 @@ send_ghostty_command() {
465471
# Escape for AppleScript: backslashes and quotes need escaping
466472
# AppleScript string literals use backslash as escape character
467473
local escaped_cmd="$cmd"
468-
escaped_cmd="${escaped_cmd//\\/\\\\}" # Escape backslashes first: \ \\
469-
escaped_cmd="${escaped_cmd//\"/\\\"}" # Then escape quotes: " \"
474+
escaped_cmd="${escaped_cmd//\\/\\\\}" # Escape backslashes first: \ ? \\
475+
escaped_cmd="${escaped_cmd//\"/\\\"}" # Then escape quotes: " ? \"
470476

471477
# Type the command and press return
472478
print_debug "AppleScript escaped: $escaped_cmd"
@@ -922,6 +928,17 @@ run_multi_agents() {
922928
fi
923929
agent_prompts+=("") # amp handles prompts via stdin, not delayed
924930
;;
931+
goose)
932+
# Goose: pass prompts via stdin using 'goose session'
933+
if (( ${#common_args[@]} )); then
934+
local prompt_joined
935+
prompt_joined=$(printf '%s ' "${common_args[@]}"); prompt_joined=${prompt_joined%% }
936+
shell_cmd="echo $(printf %q "$prompt_joined") | goose session"
937+
else
938+
cmd_arr+=("goose" "session")
939+
fi
940+
agent_prompts+=("") # goose handles prompts via stdin, not delayed
941+
;;
925942
copilot)
926943
# Copilot: doesn't support direct interactive prompts
927944
# Launch agent, then send prompt via AppleScript after startup
@@ -1155,7 +1172,7 @@ pick_random_agent() {
11551172

11561173
if [[ ${#agents[@]} -eq 0 ]]; then
11571174
print_error "no supported coding agents found in PATH"
1158-
print_info "Supported agents: codex, claude, copilot, droid, amp, cursor-agent, opencode, gemini, kimi, crush"
1175+
print_info "Supported agents: codex, claude, copilot, droid, amp, cursor-agent, opencode, gemini, kimi, crush, aider, goose"
11591176
return 1
11601177
fi
11611178

@@ -1240,7 +1257,7 @@ mop_cleanup() {
12401257
print_success "Deleted branch: $branch"
12411258
((branch_count++))
12421259
fi
1243-
done < <(git branch | sed 's/^[* ] //' | grep -E '^(claude|codex|copilot|amp|opencode|gemini|qwen|droid|cursor-agent|kimi|crush)-[0-9]+$')
1260+
done < <(git branch | sed 's/^[* ] //' | grep -E '^(claude|codex|copilot|amp|opencode|gemini|qwen|droid|cursor-agent|kimi|crush|aider|goose)-[0-9]+$')
12441261

12451262
if (( branch_count == 0 )); then
12461263
print_info "No agent branches found"
@@ -1446,7 +1463,7 @@ main() {
14461463

14471464
if [[ ${#all_agents[@]} -eq 0 ]]; then
14481465
print_error "no supported coding agents found in PATH"
1449-
print_info "Supported agents: codex, claude, copilot, droid, amp, cursor-agent, opencode, gemini, kimi, crush"
1466+
print_info "Supported agents: codex, claude, copilot, droid, amp, cursor-agent, opencode, gemini, kimi, crush, aider, goose"
14501467
exit 1
14511468
fi
14521469

@@ -1492,7 +1509,7 @@ main() {
14921509
fi
14931510

14941511
# Determine mode based on command_name format:
1495-
# - Contains spaces: it's a prompt full YOLO mode
1512+
# - Contains spaces: it's a prompt ? full YOLO mode
14961513
# - Contains commas (no spaces): multi-agent mode (agent1,agent2,agent3)
14971514
# - Single word: single-agent mode
14981515
if [[ "$command_name" == *" "* ]]; then
@@ -1544,6 +1561,16 @@ main() {
15441561
fi
15451562
fi
15461563
;;
1564+
goose)
1565+
# Goose: pass prompts via stdin using 'goose session'
1566+
if (( ${#command_args[@]} )); then
1567+
local prompt_joined
1568+
prompt_joined=$(printf '%s ' "${command_args[@]}"); prompt_joined=${prompt_joined%% }
1569+
full_command=(bash -lc "echo $(printf %q "$prompt_joined") | goose session")
1570+
else
1571+
full_command=("goose" "session")
1572+
fi
1573+
;;
15471574
copilot)
15481575
# Trust the current directory explicitly
15491576
local trust_dir

0 commit comments

Comments
 (0)