From 1d73f8e04bd92bc7c6a55ae1eaba13b4b6fd43fd Mon Sep 17 00:00:00 2001 From: A <258483684+la14-1@users.noreply.github.com> Date: Fri, 13 Feb 2026 05:56:29 -0800 Subject: [PATCH] fix: improve local script UX -- add SPAWN_PROMPT support, fix prompt escaping, standardize messages (#863) - local/cline.sh: Add missing SPAWN_PROMPT non-interactive mode support, replace manual sed -i.bak env var handling with inject_env_vars_local (eliminates leftover .bak files), add installation verification - local/plandex.sh: Replace manual shell config handling with inject_env_vars_local for consistency, fix printf '%q' prompt escaping that corrupted prompt text with literal backslashes - local/aider.sh: Fix printf '%q' prompt escaping -- pass SPAWN_PROMPT directly as quoted argument instead of shell-escaping it - local/interpreter.sh: Same printf '%q' fix as aider.sh - 7 local scripts: Standardize "Appending environment variables to ~/.zshrc..." to "Setting up environment variables..." for consistency with all other cloud providers Agent: ux-engineer Co-authored-by: A <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) --- local/aider.sh | 3 +-- local/cline.sh | 27 ++++++++++++++++++++++----- local/interpreter.sh | 3 +-- local/plandex.sh | 12 ++++-------- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/local/aider.sh b/local/aider.sh index b20f3403..d91a9dde 100644 --- a/local/aider.sh +++ b/local/aider.sh @@ -56,8 +56,7 @@ echo "" if [[ -n "${SPAWN_PROMPT:-}" ]]; then log_step "Executing Aider with prompt..." source ~/.zshrc 2>/dev/null || true - escaped_prompt=$(printf '%q' "${SPAWN_PROMPT}") - aider --model "openrouter/${MODEL_ID}" -m "${escaped_prompt}" + aider --model "openrouter/${MODEL_ID}" -m "${SPAWN_PROMPT}" else log_step "Starting Aider..." sleep 1 diff --git a/local/cline.sh b/local/cline.sh index afbb1e5e..09d65e9e 100755 --- a/local/cline.sh +++ b/local/cline.sh @@ -23,6 +23,15 @@ if ! command -v npm &>/dev/null; then fi npm install -g cline +# Verify installation +if ! command -v cline &>/dev/null; then + log_error "Cline installation failed" + log_error "The 'cline' command is not available" + log_error "Try installing manually: npm install -g cline" + exit 1 +fi +log_info "Cline installation verified" + echo "" if [[ -n "${OPENROUTER_API_KEY:-}" ]]; then log_info "Using OpenRouter API key from environment" @@ -37,10 +46,18 @@ inject_env_vars_local upload_file run_server \ "OPENAI_BASE_URL=https://openrouter.ai/api/v1" echo "" -log_info "Local machine setup completed successfully!" +log_info "Local setup completed successfully!" echo "" -log_step "Starting Cline..." -sleep 1 -clear -cline +# Start Cline +if [[ -n "${SPAWN_PROMPT:-}" ]]; then + log_step "Executing Cline with prompt..." + source ~/.zshrc 2>/dev/null || true + cline "${SPAWN_PROMPT}" +else + log_step "Starting Cline..." + sleep 1 + clear 2>/dev/null || true + source ~/.zshrc 2>/dev/null || true + exec cline +fi diff --git a/local/interpreter.sh b/local/interpreter.sh index 52b6c423..5769c711 100644 --- a/local/interpreter.sh +++ b/local/interpreter.sh @@ -55,8 +55,7 @@ echo "" if [[ -n "${SPAWN_PROMPT:-}" ]]; then log_step "Executing Open Interpreter with prompt..." source ~/.zshrc 2>/dev/null || true - escaped_prompt=$(printf '%q' "${SPAWN_PROMPT}") - interpreter -m "${escaped_prompt}" + interpreter -m "${SPAWN_PROMPT}" else log_step "Starting Open Interpreter..." sleep 1 diff --git a/local/plandex.sh b/local/plandex.sh index 81825d31..5b5bf6ed 100644 --- a/local/plandex.sh +++ b/local/plandex.sh @@ -16,7 +16,7 @@ echo "" ensure_local_ready SERVER_NAME=$(get_server_name) -log_info "Running on: ${SERVER_NAME}" +create_server "${SERVER_NAME}" # Install Plandex log_step "Installing Plandex..." @@ -51,18 +51,14 @@ echo "" if [[ -n "${SPAWN_PROMPT:-}" ]]; then # Non-interactive mode: execute prompt and exit log_step "Executing Plandex with prompt..." - - # Escape prompt for safe shell execution - escaped_prompt=$(printf '%q' "${SPAWN_PROMPT}") - - # Execute without TTY source ~/.zshrc 2>/dev/null || true - plandex new && plandex tell ${escaped_prompt} + plandex new + plandex tell "${SPAWN_PROMPT}" else # Interactive mode: start Plandex normally log_step "Starting Plandex..." sleep 1 - clear + clear 2>/dev/null || true source ~/.zshrc 2>/dev/null || true exec plandex fi