feat: auto-update CLI on major version gap#77
Open
ali-wljray wants to merge 2 commits into
Open
Conversation
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.
Summary
Add auto-update logic that automatically upgrades the CLI when a significant version gap is detected, instead of just showing a notification banner.
Auto-update trigger conditions
The CLI will auto-update when either condition is met:
2.0.0vs1.x.x)latest.minor - current.minor > 3(e.g.1.7.0vs1.3.0)For smaller version differences, the existing "Update available" banner is preserved.
示例输出效果
大版本自动更新时:
Changes
packages/cli/src/utils/update-checker.tsisMajorUpgrade(latest, current)— determines if the version gap warrants auto-updateperformAutoUpdate(currentVersion, latestVersion)— executes the auto-update flow:npm install -g bailian-cli@latestupdate-state.json)npx skills add modelstudioai/cli --all -g -y)packages/cli/src/main.tsperformAutoUpdate()for automatic upgradeDesign decisions
checkForUpdateguard)