From e3d335be2d33018f7e1fc8020a5152e4826af1ec Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 28 Jan 2026 11:23:17 +0800 Subject: [PATCH] feat(settings): prioritize native install path for Claude Code detection - Move ~/.local/bin to first position in version scan search paths - Update one-click install commands to use official native installation (curl script) instead of npm for Claude Code --- src-tauri/src/commands/misc.rs | 4 ++-- src/components/settings/AboutSection.tsx | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/commands/misc.rs b/src-tauri/src/commands/misc.rs index dec6df08..1d2124ae 100644 --- a/src-tauri/src/commands/misc.rs +++ b/src-tauri/src/commands/misc.rs @@ -295,10 +295,10 @@ fn scan_cli_version(tool: &str) -> (Option, Option) { let home = dirs::home_dir().unwrap_or_default(); - // 常见的 npm 全局安装路径 + // 常见的安装路径(原生安装优先) let mut search_paths: Vec = vec![ + home.join(".local/bin"), // Native install (official recommended) home.join(".npm-global/bin"), - home.join(".local/bin"), home.join("n/bin"), // n version manager ]; diff --git a/src/components/settings/AboutSection.tsx b/src/components/settings/AboutSection.tsx index 6194c3bc..f301e2fb 100644 --- a/src/components/settings/AboutSection.tsx +++ b/src/components/settings/AboutSection.tsx @@ -32,8 +32,11 @@ interface ToolVersion { error: string | null; } -const ONE_CLICK_INSTALL_COMMANDS = `npm i -g @anthropic-ai/claude-code@latest +const ONE_CLICK_INSTALL_COMMANDS = `# Claude Code (Native install - recommended) +curl -fsSL https://claude.ai/install.sh | bash +# Codex npm i -g @openai/codex@latest +# Gemini CLI npm i -g @google/gemini-cli@latest`; export function AboutSection({ isPortable }: AboutSectionProps) {