feat(selfupdate): added automatic version check on CLI startup#64
feat(selfupdate): added automatic version check on CLI startup#64rios0rios0 wants to merge 1 commit intomainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
There was a problem hiding this comment.
Pull request overview
Adds a passive self-update/version notification by checking for newer releases when the CLI starts up, and updates the cliforge dependency to support that behavior.
Changes:
- Bumps
github.com/rios0rios0/cliforgeto a newer pseudo-version that includes passive update checking. - Calls
CheckForUpdates()during CLI startup. - Documents the new startup update check in the changelog.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| go.mod | Updates cliforge dependency version. |
| go.sum | Updates module checksums for the new cliforge version. |
| cmd/devforge/main.go | Triggers an update check on startup via CheckForUpdates(). |
| CHANGELOG.md | Notes the new automatic version check under Unreleased. |
| rootCmd.AddCommand(newVersionCmd()) | ||
| rootCmd.AddCommand(newSelfUpdateCmd()) | ||
|
|
||
| selfupdate.NewCommand(repoOwner, repoName, binaryName, version).CheckForUpdates() |
There was a problem hiding this comment.
CheckForUpdates() is invoked unconditionally on startup before Cobra parses/executes subcommands. This means it will run for every invocation (including dev version, which is intended to be stdout-only for script/pipe compatibility, and dev self-update, which likely already checks). Consider moving the update check into a rootCmd.PersistentPreRun{E} (so you can skip specific commands) and ensure any warning/output goes to stderr and doesn’t block command execution (e.g., run with a short timeout or in a goroutine).



Summary
CheckForUpdates()call on CLI startup to warn users when a newer version is availablecliforgedependency to include the new passive version check featureTest plan
🤖 Generated with Claude Code