Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/update-third-party-source-note.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion apps/kimi-code/src/cli/update/preflight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 : '')
);
}

Expand Down
3 changes: 3 additions & 0 deletions apps/kimi-code/src/constant/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
2 changes: 2 additions & 0 deletions apps/kimi-code/test/cli/update/preflight.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
Loading