From ac9eac802566f09cdc0959756236caa5344a5319 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Jan 2026 17:47:57 +0000 Subject: [PATCH] Fix macOS Claude CLI detection in start.sh The script was failing to detect the Claude CLI on macOS because the installer places it in ~/.claude/local/bin/ which may not be in PATH during script execution (non-interactive shell). Changes: - Check common installation paths: ~/.claude/local/bin (macOS) and ~/.local/bin (Linux) - Add found path to PATH for subsequent commands - Use $CLAUDE_CMD variable for the login command - Display the found path in success message for debugging --- start.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/start.sh b/start.sh index d90c097..dc72817 100755 --- a/start.sh +++ b/start.sh @@ -8,7 +8,22 @@ echo "========================================" echo "" # Check if Claude CLI is installed -if ! command -v claude &> /dev/null; then +CLAUDE_CMD="" + +# First check if claude is already in PATH +if command -v claude &> /dev/null; then + CLAUDE_CMD="claude" +# Check common macOS installation path +elif [ -x "$HOME/.claude/local/bin/claude" ]; then + CLAUDE_CMD="$HOME/.claude/local/bin/claude" + export PATH="$HOME/.claude/local/bin:$PATH" +# Check Linux installation path +elif [ -x "$HOME/.local/bin/claude" ]; then + CLAUDE_CMD="$HOME/.local/bin/claude" + export PATH="$HOME/.local/bin:$PATH" +fi + +if [ -z "$CLAUDE_CMD" ]; then echo "[ERROR] Claude CLI not found" echo "" echo "Please install Claude CLI first:" @@ -18,7 +33,7 @@ if ! command -v claude &> /dev/null; then exit 1 fi -echo "[OK] Claude CLI found" +echo "[OK] Claude CLI found at: $CLAUDE_CMD" # Check if user has credentials CLAUDE_CREDS="$HOME/.claude/.credentials.json" @@ -37,7 +52,7 @@ else echo "Running 'claude login'..." echo "Complete the login in your browser, then return here." echo "" - claude login + $CLAUDE_CMD login # Check if login succeeded if [ -f "$CLAUDE_CREDS" ]; then