feat(cli): add --yes flag to upgrade for non-interactive installs#672
feat(cli): add --yes flag to upgrade for non-interactive installs#672grandmaster451 wants to merge 1 commit into
Conversation
Adds a `-y, --yes` option to `kimi upgrade` that skips the install prompt and proceeds directly to the foreground update when the install source supports auto-installation. If the source cannot be auto-installed, the manual install command is still printed. - Add `skipPrompt` dependency to `handleUpgrade`. - Route `upgrade --yes` through the CLI program and `handleUpgradeCommand`. - Add tests for non-interactive install, unsupported-source fallback, and CLI option routing.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dec1743e5c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| .description('Upgrade Kimi Code to the latest version.') | ||
| .action(async () => { | ||
| await onUpgrade(); | ||
| .option('-y, --yes', 'Install the update without prompting.', false) |
There was a problem hiding this comment.
Avoid reusing -y for the upgrade yes flag
When users run kimi upgrade -y, Commander parses -y as the root --yolo option because the root command already owns that short flag and Commander v13 treats parent options as usable after subcommands by default; the subcommand never sees its local yes value, and optsWithGlobals() then leaves opts.yes false. The advertised short form therefore still prompts (or falls back to the manual command in non-interactive runs). Use only the long flag, enable positional option parsing, or read the subcommand-local option without the parent merge.
Useful? React with 👍 / 👎.
Adds a
-y, --yesoption tokimi upgradethat skips the install prompt and proceeds directly to the foreground update when the install source supports auto-installation. If the source cannot be auto-installed, the manual install command is still printed.Changes
skipPromptdependency tohandleUpgrade.upgrade --yesthrough the CLI program andhandleUpgradeCommand.Testing
pnpm vitest run apps/kimi-code/test/cli/upgrade.test.tspnpm vitest run apps/kimi-code/test/cli/options.test.tspnpm run typecheckinapps/kimi-code