Launch the default coding agent without permission prompts (#6729)

Every supported agent spells it differently, so map each one to its own
bypass flag instead of leaving the launcher at each agent's default.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-08-12 08:56:03 +02:00
committed by GitHub
co-authored by Claude Opus 5
parent 2fa490dc96
commit d6b21f8075
2 changed files with 68 additions and 34 deletions
+24 -18
View File
@@ -26,37 +26,43 @@ if (($# > 0)); then
prompt="$*"
fi
# Agents launched from the keybinding or menu run unattended, so each one starts
# with its own spelling of "don't stop to ask". Pi has no approval prompts.
case "$agent" in
opencode)
if [[ -n ${prompt:-} ]]; then
command=(opencode --prompt "$prompt")
else
command=(opencode)
fi
command=(opencode --auto)
[[ -n ${prompt:-} ]] && command+=(--prompt "$prompt")
;;
gemini)
if [[ -n ${prompt:-} ]]; then
command=(gemini --prompt-interactive "$prompt")
else
command=(gemini)
fi
command=(gemini --yolo)
[[ -n ${prompt:-} ]] && command+=(--prompt-interactive "$prompt")
;;
copilot)
if [[ -n ${prompt:-} ]]; then
command=(copilot --interactive "$prompt")
else
command=(copilot)
fi
command=(copilot --allow-all)
[[ -n ${prompt:-} ]] && command+=(--interactive "$prompt")
;;
crush)
# --yolo belongs to the interactive command only; `crush run` never prompts.
if [[ -n ${prompt:-} ]]; then
command=(crush run "$prompt")
else
command=(crush)
command=(crush --yolo)
fi
;;
pi | omp | claude | codex | grok)
command=("$agent")
claude | grok)
command=("$agent" --permission-mode bypassPermissions)
[[ -n ${prompt:-} ]] && command+=(-- "$prompt")
;;
codex)
command=(codex --dangerously-bypass-approvals-and-sandbox)
[[ -n ${prompt:-} ]] && command+=(-- "$prompt")
;;
omp)
command=(omp --auto-approve)
[[ -n ${prompt:-} ]] && command+=(-- "$prompt")
;;
pi)
command=(pi)
[[ -n ${prompt:-} ]] && command+=(-- "$prompt")
;;
*)