diff --git a/.changeset/add-update-alias.md b/.changeset/add-update-alias.md new file mode 100644 index 000000000..267c556ed --- /dev/null +++ b/.changeset/add-update-alias.md @@ -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. diff --git a/apps/kimi-code/src/cli/commands.ts b/apps/kimi-code/src/cli/commands.ts index 2ca5dadd7..32a65eb0e 100644 --- a/apps/kimi-code/src/cli/commands.ts +++ b/apps/kimi-code/src/cli/commands.ts @@ -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(); diff --git a/apps/kimi-code/test/cli/options.test.ts b/apps/kimi-code/test/cli/options.test.ts index c82281932..73d759841 100644 --- a/apps/kimi-code/test/cli/options.test.ts +++ b/apps/kimi-code/test/cli/options.test.ts @@ -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', diff --git a/docs/en/reference/kimi-command.md b/docs/en/reference/kimi-command.md index 54b139a0c..d14fafa4a 100644 --- a/docs/en/reference/kimi-command.md +++ b/docs/en/reference/kimi-command.md @@ -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 diff --git a/docs/zh/reference/kimi-command.md b/docs/zh/reference/kimi-command.md index b410844d8..187cc48aa 100644 --- a/docs/zh/reference/kimi-command.md +++ b/docs/zh/reference/kimi-command.md @@ -274,7 +274,7 @@ kimi migrate ### `kimi upgrade` -立即检查最新版本并展示更新提示,选择操作后退出。 +立即检查最新版本并展示更新提示,选择操作后退出。也可以使用别名 `kimi update`。 ```sh kimi upgrade