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
This commit is contained in:
程序员阿江(Relakkes) 2026-04-23 12:51:17 +08:00
parent 5fea7033e3
commit 1137c99d5c
4 changed files with 58 additions and 0 deletions

View File

@ -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')
})
})

View File

@ -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 }) {
})}
</p>
)}
<div className="rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-3">
<p className="text-xs leading-6 text-[var(--color-text-secondary)]">
{t('settings.install.cliSharedConfig')}
</p>
<div className="mt-3 space-y-2">
{exampleCommands.map((example) => (
<div key={example.command} className="space-y-1">
<p className="text-[11px] text-[var(--color-text-tertiary)]">
{example.label}
</p>
<div className="rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-container-low)] px-3 py-2 font-mono text-xs text-[var(--color-text-primary)] break-all">
{example.command}
</div>
</div>
))}
</div>
</div>
</div>
)
}

View File

@ -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',

View File

@ -319,6 +319,9 @@ export const zh: Record<TranslationKey, string> = {
'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': '执行目录',