From 1137c99d5c0f0326dba31de054d2c2817657df8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Thu, 23 Apr 2026 12:51:17 +0800 Subject: [PATCH] Clarify how to use shared CLI install commands after desktop setup The Install Center now spells out the two supported terminal flows after the bundled launcher is available: keep using `claude` when the official Claude Code CLI is already installed, or use `claude-haha` otherwise. It also shows copyable example commands so users understand that Skills, Plugins, and MCP configuration is shared between both command names. Constraint: The worktree contains unrelated icon, provider-label, and other UI edits, so this commit stages only the Install Center hint copy and its focused test Rejected: Leave the launcher status card without command guidance | users would still not know when to use `claude` versus `claude-haha` Rejected: Duplicate the same explanation in a new settings section | it adds UI weight without improving discoverability over the existing CLI card Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep the examples aligned with the real supported command surface; if launcher behavior changes, update both zh/en copy and the InstallCenter test together Tested: cd desktop && bun x vitest run src/components/settings/InstallCenter.test.tsx; cd desktop && bun run lint Not-tested: Full desktop production build and manual Settings page click-through after this copy-only follow-up --- .../settings/InstallCenter.test.tsx | 14 +++++++ .../src/components/settings/InstallCenter.tsx | 38 +++++++++++++++++++ desktop/src/i18n/locales/en.ts | 3 ++ desktop/src/i18n/locales/zh.ts | 3 ++ 4 files changed, 58 insertions(+) diff --git a/desktop/src/components/settings/InstallCenter.test.tsx b/desktop/src/components/settings/InstallCenter.test.tsx index 692121f7..3234c205 100644 --- a/desktop/src/components/settings/InstallCenter.test.tsx +++ b/desktop/src/components/settings/InstallCenter.test.tsx @@ -109,6 +109,9 @@ vi.mock('../../i18n', () => { 'settings.install.cliLocation': 'CLI 路径', 'settings.install.cliConfigTarget': 'PATH 集成目标:{target}', 'settings.install.cliError': '内置 CLI 配置告警:{message}', + 'settings.install.cliSharedConfig': '后续如果你想直接通过命令行安装 Skills、Plugins 或 MCP:电脑上本身装了官方 Claude Code,就继续使用 `claude`;如果没有,就使用 `claude-haha`。这两条命令共用同一套 Skills / Plugins / MCP 配置。', + 'settings.install.cliUseOfficial': '如果你已经安装了官方 Claude Code,继续用原版命令:', + 'settings.install.cliUseBundled': '如果没有官方 CLI,就使用我们打包的 `{command}`:', 'settings.install.contextDefault': '默认目录提示', 'settings.install.contextUsing': '当前安装会话目录:{path}', 'settings.install.contextTitle': '执行目录', @@ -216,6 +219,17 @@ describe('InstallCenter', () => { expect(await screen.findByText('claude-haha')).toBeInTheDocument() expect(screen.getByText('已安装完成;请新开一个终端以加载 PATH 变更。')).toBeInTheDocument() + expect(screen.getByText(/共用同一套 Skills \/ Plugins \/ MCP 配置/)).toBeInTheDocument() + expect( + screen.getByText( + 'claude plugin install skill-creator@claude-plugins-official --scope user', + ), + ).toBeInTheDocument() + expect( + screen.getByText( + 'claude-haha mcp add docs --transport http https://example.com/mcp', + ), + ).toBeInTheDocument() expect(screen.getByTestId('message-list')).toHaveTextContent('session:installer-1') }) }) diff --git a/desktop/src/components/settings/InstallCenter.tsx b/desktop/src/components/settings/InstallCenter.tsx index 49cf97db..53aba245 100644 --- a/desktop/src/components/settings/InstallCenter.tsx +++ b/desktop/src/components/settings/InstallCenter.tsx @@ -482,6 +482,26 @@ export function InstallCenter() { function CliLauncherStatusPanel({ status }: { status: CliLauncherStatus }) { const t = useTranslation() + const bundledCommand = status.command || 'claude-haha' + const exampleCommands = [ + { + label: t('settings.install.cliUseOfficial'), + command: + 'claude plugin install skill-creator@claude-plugins-official --scope user', + }, + { + label: t('settings.install.cliUseBundled', { + command: bundledCommand, + }), + command: `${bundledCommand} plugin install skill-creator@claude-plugins-official --scope user`, + }, + { + label: t('settings.install.cliUseBundled', { + command: bundledCommand, + }), + command: `${bundledCommand} mcp add docs --transport http https://example.com/mcp`, + }, + ] let statusText = t('settings.install.cliUnavailable') let statusClassName = 'border-[var(--color-danger)]/25 bg-[var(--color-danger)]/10 text-[var(--color-danger)]' @@ -530,6 +550,24 @@ function CliLauncherStatusPanel({ status }: { status: CliLauncherStatus }) { })}

)} + +
+

+ {t('settings.install.cliSharedConfig')} +

+
+ {exampleCommands.map((example) => ( +
+

+ {example.label} +

+
+ {example.command} +
+
+ ))} +
+
) } diff --git a/desktop/src/i18n/locales/en.ts b/desktop/src/i18n/locales/en.ts index c6424e52..92dbacf2 100644 --- a/desktop/src/i18n/locales/en.ts +++ b/desktop/src/i18n/locales/en.ts @@ -317,6 +317,9 @@ export const en = { 'settings.install.cliLocation': 'CLI path', 'settings.install.cliConfigTarget': 'PATH integration target: {target}', 'settings.install.cliError': 'Bundled CLI setup warning: {message}', + 'settings.install.cliSharedConfig': 'For direct terminal installs later, keep using `claude` if the official Claude Code CLI is already installed. Otherwise use `claude-haha`. Both command paths share the same Skills / Plugins / MCP state.', + 'settings.install.cliUseOfficial': 'If the official Claude Code CLI is already installed, keep using it:', + 'settings.install.cliUseBundled': 'If not, use our bundled `{command}` command:', 'settings.install.contextDefault': 'If no directory is selected, the installer session starts from your home directory.', 'settings.install.contextUsing': 'Installer session directory: {path}', 'settings.install.contextTitle': 'Execution directory', diff --git a/desktop/src/i18n/locales/zh.ts b/desktop/src/i18n/locales/zh.ts index 370d36a1..ff644c69 100644 --- a/desktop/src/i18n/locales/zh.ts +++ b/desktop/src/i18n/locales/zh.ts @@ -319,6 +319,9 @@ export const zh: Record = { 'settings.install.cliLocation': 'CLI 路径', 'settings.install.cliConfigTarget': 'PATH 集成目标:{target}', 'settings.install.cliError': '内置 CLI 配置告警:{message}', + 'settings.install.cliSharedConfig': '后续如果你想直接通过命令行安装 Skills、Plugins 或 MCP:电脑上本身装了官方 Claude Code,就继续使用 `claude`;如果没有,就使用 `claude-haha`。这两条命令共用同一套 Skills / Plugins / MCP 配置。', + 'settings.install.cliUseOfficial': '如果你已经安装了官方 Claude Code,继续用原版命令:', + 'settings.install.cliUseBundled': '如果没有官方 CLI,就使用我们打包的 `{command}`:', 'settings.install.contextDefault': '未指定目录时默认使用 Home 目录启动安装会话。', 'settings.install.contextUsing': '当前安装会话目录:{path}', 'settings.install.contextTitle': '执行目录',