From adc6231b98886f0bc35cb04d04d948eba2f0f058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=A0=8B=E6=A2=81?= Date: Wed, 3 Dec 2025 16:07:09 +0800 Subject: [PATCH] feat: support native installed Claude CLI detection Add automatic detection for Claude CLI installed via native methods: - curl https://claude.ai/install.sh | bash -> ~/.local/bin/claude - brew install --cask claude-code -> /opt/homebrew/bin/claude (Apple Silicon) - brew install --cask claude-code -> /usr/local/bin/claude (Intel Mac/Linux) When claude is not found in PATH, the script checks these paths in order and adds the first found to PATH, with informative log messages. Closes #303 --- run-server.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/run-server.sh b/run-server.sh index 7c891a3..034dbab 100755 --- a/run-server.sh +++ b/run-server.sh @@ -1230,6 +1230,26 @@ check_claude_cli_integration() { local python_cmd="$1" local server_path="$2" + # Check for native installed Claude CLI (not in PATH by default) + # Native installs: + # - curl https://claude.ai/install.sh | bash -> ~/.local/bin/claude + # - brew install --cask claude-code -> /opt/homebrew/bin/claude (Apple Silicon) or /usr/local/bin/claude (Intel) + if ! command -v claude &> /dev/null; then + local claude_paths=( + "$HOME/.local/bin" + "/opt/homebrew/bin" + "/usr/local/bin" + ) + for dir in "${claude_paths[@]}"; do + if [[ -x "$dir/claude" ]]; then + print_info "Found native installed Claude CLI at $dir/claude" + export PATH="$dir:$PATH" + print_success "Added $dir to PATH" + break + fi + done + fi + if ! command -v claude &> /dev/null; then echo "" print_warning "Claude CLI not found"