Add update notifier to CLI#3096
Merged
youknowriad merged 7 commits intotrunkfrom Apr 15, 2026
Merged
Conversation
Show a banner at the top of CLI output when a newer version of wp-studio is available on npm. Includes a changelog link to the Studio docs page. The check is cached for 24 hours and suppressed in IPC mode or with --json. Fixes STU-1449 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
📊 Performance Test ResultsComparing 0eebd17 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
fredrikekelund
approved these changes
Apr 15, 2026
Contributor
fredrikekelund
left a comment
There was a problem hiding this comment.
The fundamental strategy looks good to me, and this works as expected in testing 👍
I left a couple of implementation-focused comments that we should address before landing, but I'll still approve straight away to unblock you, @youknowriad
- Use zod schemas to validate cache file and npm registry response - Use atomically library for cache writes to avoid concurrent conflicts - Reduce fetch timeout from 5s to 3s Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move lastChecked/latestVersion into the existing cli.json config file as an optional updateCheck field. Writes use updateCliConfigWithPartial (with locking), reads use a direct sync fs.readFileSync for the banner. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Make setupUpdateNotifier async and await it so the fetch completes before the process exits. This ensures the cache is written and the banner shows even for quick commands like --version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sejas
approved these changes
Apr 15, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Skip the update notifier when __IS_PACKAGED_FOR_NPM__ is false, since bundled CLI users should update via the desktop app instead of npm. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 issues
How AI was used in this PR
Claude authored the implementation and tests based on design decisions made collaboratively. All code was reviewed and tested manually.
Proposed Changes
wp-studioand displays a banner at the top of CLI outputnpm updatecommand, and a link to the changelog at https://developer.wordpress.com/docs/developer-tools/studio/changelog/--jsonflag is usedTesting Instructions
npm run cli:buildapps/cli/package.jsonto an old version (e.g.,1.0.0), rebuild, then run any command twice:--version,site list, and other commands--jsonflagPre-merge Checklist