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': '执行目录',