Skip to content

feat(cli): add --yes flag to upgrade for non-interactive installs#672

Open
grandmaster451 wants to merge 1 commit into
MoonshotAI:mainfrom
grandmaster451:feat/non-interactive-upgrade
Open

feat(cli): add --yes flag to upgrade for non-interactive installs#672
grandmaster451 wants to merge 1 commit into
MoonshotAI:mainfrom
grandmaster451:feat/non-interactive-upgrade

Conversation

@grandmaster451

Copy link
Copy Markdown

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.

Changes

  • 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.

Testing

  • pnpm vitest run apps/kimi-code/test/cli/upgrade.test.ts
  • pnpm vitest run apps/kimi-code/test/cli/options.test.ts
  • pnpm run typecheck in apps/kimi-code

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.
@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dec1743

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant