feat(updater): add -y/--yes to skip the upgrade confirmation prompt - #3702
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: c57be72 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Internal request (no linked issue): add a non-interactive flag to
kimi update.Problem
kimi upgrade(aliaskimi 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/--yesplaced after the subcommand name is swallowed by the main command's-y, --yolo(and hidden--yes), and the subcommand action receivesfalse. The same mechanism means the existingkimi fork -yandkimi export -yflags have been silently broken in production (their tests register subcommands on a bareCommand, so the collision never showed).What changed
kimi upgrade/kimi updateaccepts-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.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 restoreskimi fork -y/kimi export -yas a side effect; main-command usage (kimi -y, etc.) is unaffected.yesthroughhandleUpgradeCommandintohandleUpgrade's deps; the prompt (and itsupgrade_command_promptedtelemetry) is skipped when set,upgrade_command_install_selectedstill fires.yesvalue, the non-interactive upgrade case covers direct install withyes, andmain.test.tsasserts the dep is passed through.Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.