diff --git a/.changeset/update-third-party-source-note.md b/.changeset/update-third-party-source-note.md new file mode 100644 index 0000000000..1931f0b911 --- /dev/null +++ b/.changeset/update-third-party-source-note.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Add a reminder for third-party install sources to use the official installer in the update prompt. diff --git a/README.md b/README.md index d17d143e34..e3e17adb8c 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,6 @@ Install with the official script. No Node.js required. curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash ``` -- **Homebrew (macOS/Linux)**: - -```sh -brew install kimi-code -``` - - **Windows (PowerShell)**: ```powershell diff --git a/README.zh-CN.md b/README.zh-CN.md index e60fd158e5..cf583f9b85 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -22,12 +22,6 @@ Kimi Code CLI 是一个运行在终端里的 AI 编程 agent,可以帮你读 curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash ``` -- **Homebrew(macOS / Linux)**: - -```sh -brew install kimi-code -``` - - **Windows(PowerShell)**: ```powershell diff --git a/apps/kimi-code/src/cli/update/preflight.ts b/apps/kimi-code/src/cli/update/preflight.ts index 5fda96d6ae..098899035c 100644 --- a/apps/kimi-code/src/cli/update/preflight.ts +++ b/apps/kimi-code/src/cli/update/preflight.ts @@ -4,6 +4,7 @@ import { log, type Logger } from '@moonshot-ai/kimi-code-sdk'; import type { TelemetryProperties } from '@moonshot-ai/kimi-telemetry'; import { + KIMI_CODE_OFFICIAL_INSTALL_URL, NATIVE_INSTALL_COMMAND_UNIX, NATIVE_INSTALL_COMMAND_WIN, } from '#/constant/app'; @@ -141,6 +142,10 @@ function formatErrorMessage(error: unknown): string { return error instanceof Error ? error.message : String(error); } +const THIRD_PARTY_SOURCE_NOTE = + '\nNote: Third-party sources may lag behind the official release.\n' + + `For the latest updates, use the official installer: ${KIMI_CODE_OFFICIAL_INSTALL_URL}\n`; + export function renderManualUpdateMessage( currentVersion: string, target: UpdateTarget, @@ -169,7 +174,8 @@ export function renderManualUpdateMessage( `A newer version of ${NPM_PACKAGE_NAME} is available ` + `(${currentVersion} -> ${target.version}).\n` + `Detected install source: ${sourceDesc}\n` + - `To update manually, run: ${installCommand}\n` + `To update manually, run: ${installCommand}\n` + + (source === 'homebrew' ? THIRD_PARTY_SOURCE_NOTE : '') ); } diff --git a/apps/kimi-code/src/constant/app.ts b/apps/kimi-code/src/constant/app.ts index c3a599df95..f09cc600ae 100644 --- a/apps/kimi-code/src/constant/app.ts +++ b/apps/kimi-code/src/constant/app.ts @@ -81,6 +81,9 @@ export const KIMI_CODE_PLUGIN_MARKETPLACE_URL = `${KIMI_CODE_CDN_BASE}/plugins/m export const KIMI_CODE_PLUGIN_MARKETPLACE_URL_ENV = 'KIMI_CODE_PLUGIN_MARKETPLACE_URL'; export const KIMI_CODE_INSTALL_SH_URL = `${KIMI_CODE_CDN_BASE}/install.sh`; export const KIMI_CODE_INSTALL_PS1_URL = `${KIMI_CODE_CDN_BASE}/install.ps1`; +// Official download page, referenced by prompt copy that steers users away +// from third-party install sources. +export const KIMI_CODE_OFFICIAL_INSTALL_URL = 'https://www.kimi.com/code'; // Native install commands, split by platform. Use these for prompt copy and spawn calls only; do not assemble the strings elsewhere. export const NATIVE_INSTALL_COMMAND_UNIX = `curl -fsSL ${KIMI_CODE_INSTALL_SH_URL} | bash`; diff --git a/apps/kimi-code/test/cli/update/preflight.test.ts b/apps/kimi-code/test/cli/update/preflight.test.ts index ae6dd3bc03..2f7439f51b 100644 --- a/apps/kimi-code/test/cli/update/preflight.test.ts +++ b/apps/kimi-code/test/cli/update/preflight.test.ts @@ -485,6 +485,8 @@ describe('runUpdatePreflight', () => { const { stdout, options } = captureOutput(); await expect(runUpdatePreflight('0.4.0', options)).resolves.toBe('continue'); expect(stdout.join('')).toContain('brew upgrade kimi-code'); + expect(stdout.join('')).toContain('Third-party sources may lag behind the official release.'); + expect(stdout.join('')).toContain('https://www.kimi.com/code'); expect(promptForInstallChoice).not.toHaveBeenCalled(); expect(mocks.spawn).not.toHaveBeenCalled(); });