From c8dee8ed240e4f0ad999b957df5d83b9d2d57bf6 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Tue, 21 Jul 2026 20:03:23 +0800 Subject: [PATCH 1/5] feat(cli): add third-party source note to update prompt --- .changeset/update-third-party-source-note.md | 5 +++++ README.md | 6 ------ README.zh-CN.md | 6 ------ apps/kimi-code/src/cli/update/preflight.ts | 9 ++++++++- apps/kimi-code/test/cli/update/preflight.test.ts | 2 ++ 5 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 .changeset/update-third-party-source-note.md diff --git a/.changeset/update-third-party-source-note.md b/.changeset/update-third-party-source-note.md new file mode 100644 index 0000000000..4c218135d8 --- /dev/null +++ b/.changeset/update-third-party-source-note.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Add a note to the update prompt for third-party install sources that they may lag behind the latest release, recommending the official installer. 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..2f0fe7ca5e 100644 --- a/apps/kimi-code/src/cli/update/preflight.ts +++ b/apps/kimi-code/src/cli/update/preflight.ts @@ -141,6 +141,12 @@ function formatErrorMessage(error: unknown): string { return error instanceof Error ? error.message : String(error); } +const OFFICIAL_INSTALL_URL = 'https://www.kimi.com/code'; + +const THIRD_PARTY_SOURCE_NOTE = + '\nNote: Third-party sources may lag behind the latest release.\n' + + `For the latest updates, use the official installer: ${OFFICIAL_INSTALL_URL}\n`; + export function renderManualUpdateMessage( currentVersion: string, target: UpdateTarget, @@ -169,7 +175,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/test/cli/update/preflight.test.ts b/apps/kimi-code/test/cli/update/preflight.test.ts index ae6dd3bc03..ac5a8d0eff 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 latest release.'); + expect(stdout.join('')).toContain('https://www.kimi.com/code'); expect(promptForInstallChoice).not.toHaveBeenCalled(); expect(mocks.spawn).not.toHaveBeenCalled(); }); From 2a21e5040c7238ff59674d2b09dac3c97d3328e7 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Tue, 21 Jul 2026 20:13:47 +0800 Subject: [PATCH 2/5] fix(cli): adjust third-party source note wording --- .changeset/update-third-party-source-note.md | 2 +- apps/kimi-code/src/cli/update/preflight.ts | 2 +- apps/kimi-code/test/cli/update/preflight.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.changeset/update-third-party-source-note.md b/.changeset/update-third-party-source-note.md index 4c218135d8..27948b59fb 100644 --- a/.changeset/update-third-party-source-note.md +++ b/.changeset/update-third-party-source-note.md @@ -2,4 +2,4 @@ "@moonshot-ai/kimi-code": patch --- -Add a note to the update prompt for third-party install sources that they may lag behind the latest release, recommending the official installer. +Add a note to the update prompt for third-party install sources that they may lag behind the official release, recommending the official installer. diff --git a/apps/kimi-code/src/cli/update/preflight.ts b/apps/kimi-code/src/cli/update/preflight.ts index 2f0fe7ca5e..3ec7ba71b5 100644 --- a/apps/kimi-code/src/cli/update/preflight.ts +++ b/apps/kimi-code/src/cli/update/preflight.ts @@ -144,7 +144,7 @@ function formatErrorMessage(error: unknown): string { const OFFICIAL_INSTALL_URL = 'https://www.kimi.com/code'; const THIRD_PARTY_SOURCE_NOTE = - '\nNote: Third-party sources may lag behind the latest release.\n' + + '\nNote: Third-party sources may lag behind the official release.\n' + `For the latest updates, use the official installer: ${OFFICIAL_INSTALL_URL}\n`; export function renderManualUpdateMessage( diff --git a/apps/kimi-code/test/cli/update/preflight.test.ts b/apps/kimi-code/test/cli/update/preflight.test.ts index ac5a8d0eff..2f7439f51b 100644 --- a/apps/kimi-code/test/cli/update/preflight.test.ts +++ b/apps/kimi-code/test/cli/update/preflight.test.ts @@ -485,7 +485,7 @@ 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 latest release.'); + 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(); From 45df53ec6abedfdae866d41e53676c2f5a948be0 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Tue, 21 Jul 2026 20:28:56 +0800 Subject: [PATCH 3/5] refactor(cli): move official install URL into app constants --- apps/kimi-code/src/cli/update/preflight.ts | 5 ++--- apps/kimi-code/src/constant/app.ts | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/kimi-code/src/cli/update/preflight.ts b/apps/kimi-code/src/cli/update/preflight.ts index 3ec7ba71b5..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,11 +142,9 @@ function formatErrorMessage(error: unknown): string { return error instanceof Error ? error.message : String(error); } -const OFFICIAL_INSTALL_URL = 'https://www.kimi.com/code'; - const THIRD_PARTY_SOURCE_NOTE = '\nNote: Third-party sources may lag behind the official release.\n' + - `For the latest updates, use the official installer: ${OFFICIAL_INSTALL_URL}\n`; + `For the latest updates, use the official installer: ${KIMI_CODE_OFFICIAL_INSTALL_URL}\n`; export function renderManualUpdateMessage( currentVersion: string, 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`; From e2c69dfe6cd96ddb27d2e371421b88cda4718a12 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Tue, 21 Jul 2026 20:31:44 +0800 Subject: [PATCH 4/5] chore: simplify changeset wording --- .changeset/update-third-party-source-note.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/update-third-party-source-note.md b/.changeset/update-third-party-source-note.md index 27948b59fb..2570f9b104 100644 --- a/.changeset/update-third-party-source-note.md +++ b/.changeset/update-third-party-source-note.md @@ -2,4 +2,4 @@ "@moonshot-ai/kimi-code": patch --- -Add a note to the update prompt for third-party install sources that they may lag behind the official release, recommending the official installer. +Add a reminder to use the official installer in the update prompt. From abaa34290d2b6d81318587395f2c8e8838ded315 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Tue, 21 Jul 2026 20:37:07 +0800 Subject: [PATCH 5/5] chore: adjust changeset wording --- .changeset/update-third-party-source-note.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/update-third-party-source-note.md b/.changeset/update-third-party-source-note.md index 2570f9b104..1931f0b911 100644 --- a/.changeset/update-third-party-source-note.md +++ b/.changeset/update-third-party-source-note.md @@ -2,4 +2,4 @@ "@moonshot-ai/kimi-code": patch --- -Add a reminder to use the official installer in the update prompt. +Add a reminder for third-party install sources to use the official installer in the update prompt.