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/add-update-alias.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Add an `update` alias for the `kimi upgrade` command. Run `kimi update` to upgrade to the latest version.
1 change: 1 addition & 0 deletions apps/kimi-code/src/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export function createProgram(
registerMigrateCommand(program, onMigrate);
program
.command('upgrade')
.alias('update')
.description('Upgrade Kimi Code to the latest version.')
.action(async () => {
await onUpgrade();
Expand Down
24 changes: 24 additions & 0 deletions apps/kimi-code/test/cli/options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,30 @@ describe('CLI options parsing', () => {
expect(upgradeCalls).toBe(1);
});

it('routes update alias to the upgrade handler', () => {
let upgradeCalls = 0;
const program = createProgram(
'0.0.0',
() => {
throw new Error('main action should not run');
},
() => {},
() => {},
() => {
upgradeCalls += 1;
},
);
program.exitOverride();
program.configureOutput({
writeOut: () => {},
writeErr: () => {},
});

program.parse(['node', 'kimi', 'update']);

expect(upgradeCalls).toBe(1);
});

it('registers the visible sub-commands', () => {
const program = createProgram(
'0.0.0',
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/kimi-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ For full migration instructions, see [Migrating from kimi-cli](../guides/migrati

### `kimi upgrade`

Immediately check for the latest version and display an update prompt; exits after you make a selection.
Immediately check for the latest version and display an update prompt; exits after you make a selection. `kimi update` is an alias for this command.

```sh
kimi upgrade
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/reference/kimi-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ kimi migrate

### `kimi upgrade`

立即检查最新版本并展示更新提示,选择操作后退出。
立即检查最新版本并展示更新提示,选择操作后退出。也可以使用别名 `kimi update`。

```sh
kimi upgrade
Expand Down
Loading