Skip to content

feat(updater): add -y/--yes to skip the upgrade confirmation prompt - #3702

Merged
sailist merged 1 commit into
MoonshotAI:mainfrom
sailist:feat-185-09-10-update-yes-flag
Sep 10, 2026
Merged

feat(updater): add -y/--yes to skip the upgrade confirmation prompt#3702
sailist merged 1 commit into
MoonshotAI:mainfrom
sailist:feat-185-09-10-update-yes-flag

Conversation

@sailist

@sailist sailist commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

Internal request (no linked issue): add a non-interactive flag to kimi update.

Problem

kimi upgrade (alias kimi update) always stops at an interactive arrow-key confirmation before installing, so it cannot run unattended in scripts or automation.

While wiring the flag through, we found the root cause that would have made it silently useless: commander v13 treats program-level options as global — a -y/--yes placed after the subcommand name is swallowed by the main command's -y, --yolo (and hidden --yes), and the subcommand action receives false. The same mechanism means the existing kimi fork -y and kimi export -y flags have been silently broken in production (their tests register subcommands on a bare Command, so the collision never showed).

What changed

  • kimi upgrade/kimi update accepts -y, --yes: skips the confirmation prompt and installs the update directly, including in non-interactive terminals. Without the flag the flow is unchanged; install sources that cannot auto-install still print the manual command.
  • Enabled enablePositionalOptions() on the program so parent options are only recognized before the subcommand name — the commander-documented fix for reusing an option name in subcommands. This restores kimi fork -y / kimi export -y as a side effect; main-command usage (kimi -y, etc.) is unaffected.
  • Threaded yes through handleUpgradeCommand into handleUpgrade's deps; the prompt (and its upgrade_command_prompted telemetry) is skipped when set, upgrade_command_install_selected still fires.
  • Tests extended in place (net-zero case count): program routing now asserts the parsed yes value, the non-interactive upgrade case covers direct install with yes, and main.test.ts asserts the dep is passed through.
  • Reference docs (en/zh) updated for the new flag; patch changeset added.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: the issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c57be72

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 10, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@c57be72
npx https://pkg.pr.new/@moonshot-ai/kimi-code@c57be72

commit: c57be72

@sailist
sailist merged commit 42998cf into MoonshotAI:main Sep 10, 2026
16 checks passed
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