Repository navigation
feat(cli): show an update-available notice after every command - #39
Merged
Merged
Conversation
After any command finishes, a pnpm-style box on stderr announces a newer published version, its changelog URL, and the exact command to update — detected from how the binary was installed (npm, pnpm, yarn, bun, npx, or Homebrew; npm as the fallback). The registry lookup starts before the command runs so the round-trip overlaps real work, is cached for 24 hours in the data directory, gives up silently after 1.5 s, and can never change an exit code or touch stdout. NO_UPDATE_NOTIFIER, CI, VETA_NO_UPDATE_CHECK, a non-TTY stderr, and the completion path all disable it.
cmglezpdev
force-pushed
the
claude/cli-update-notification-5d947f
branch
from
August 20, 2026 00:31
850879e to
b24a712
Compare
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.
What this changes
After any
vetacommand finishes, a pnpm-style box on stderr announces a newer published version, its changelog URL, and the exact command to update — inferred from how the binary was installed (npm, pnpm, yarn, bun, npx, or Homebrew; npm as the fallback).Why
Users of a globally installed CLI have no signal that a newer version exists; they stay on old releases until something breaks. The box surfaces the update the moment they use the tool, without ever performing the update itself — which installer owns the binary is the user's business, so veta suggests the command instead of running one.
How to verify
Live, with a seeded cache pretending 0.12.0 is out:
The box renders after the version line.
CI=1in front silences it;2>/dev/nullshows stdout stays a pure0.10.0.<dataDir>/update-check.jsonvia the existingatomic-jsonhelpers; a futurecheckedAt(clock skew) counts as stale.update-notifierconvention (NO_UPDATE_NOTIFIER,CI) plusVETA_NO_UPDATE_CHECK; non-TTY stderr and the completion path never check at all, keeping D17's fast completion promise.src/cli/update/behind injected deps (fetchLatest,cache,now), so tests cover timeout, TTL, and failure without network or real time.Checklist
pnpm typecheckandpnpm testpass (468 passed, 1 skipped live test)feat→ minor, intendeddomain/imports nothing outsidedomain/— untouched by this PRsrc/adapters/ytdlp/— none addedvi.mock, module-levelvi.spyOn, orvi.useFakeTimerswas added — the timeout test uses a real 5 ms abort, caches use temp dirsAnything unresolved
fetchLatestFromNpmitself is not unit-tested (it would need network or fetch mocking); everything around it is, behind the injectedfetchLatest.run-extractionthumbnail,extractflat-package) are flaky under full-suite load and pass in isolation — unrelated to this change, being fixed separately.