Enhance claude-codex function to support YOLO mode and improve argument handling

This commit is contained in:
Philip Henning 2026-07-24 10:05:30 +02:00
parent 87c7800fc6
commit 1d4cc6df72

View file

@ -115,6 +115,8 @@ fabric() {
claude-codex() { claude-codex() {
local gateway_url="${CLAUDE_CODEX_BASE_URL:-http://localhost:18765}" local gateway_url="${CLAUDE_CODEX_BASE_URL:-http://localhost:18765}"
local model local model
local yolo_reply
local -a claude_args=("$@")
local -a models=() local -a models=()
local -a fallback_models=( local -a fallback_models=(
gpt-5.6-sol gpt-5.6-sol
@ -145,6 +147,11 @@ claude-codex() {
done done
fi fi
if read -q "yolo_reply?Run Claude in YOLO mode? [y/N] "; then
claude_args+=(--dangerously-skip-permissions)
fi
print
ANTHROPIC_BASE_URL="${gateway_url}" \ ANTHROPIC_BASE_URL="${gateway_url}" \
ANTHROPIC_AUTH_TOKEN=unused \ ANTHROPIC_AUTH_TOKEN=unused \
ANTHROPIC_MODEL="${model}[1m]" \ ANTHROPIC_MODEL="${model}[1m]" \
@ -152,7 +159,7 @@ claude-codex() {
CLAUDE_CODE_AUTO_COMPACT_WINDOW=272000 \ CLAUDE_CODE_AUTO_COMPACT_WINDOW=272000 \
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \ CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1 \ CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1 \
command claude "$@" command claude "${claude_args[@]}"
} }
####################################### #######################################