feat(cli): add passive update notifier and version command - #245
Merged
Conversation
✅ knip — no dead codeNo unused files, exports, types, or dependencies detected. |
iamfj
marked this pull request as ready for review
July 2, 2026 20:15
Adds a `version` command (with a `version check` subcommand) and an inline, stderr-only "update available" notifier that runs before every command. The notifier only fires on interactive TTY runs, caches the npm registry lookup on disk for 24h, and fails silently so it never affects command output or the JSON contract agents rely on. Honors NO_UPDATE_NOTIFIER, LINEARIS_NO_UPDATE_CHECK, and CI.
iamfj
force-pushed
the
conductor/iamfj-cli-update-notice
branch
from
July 2, 2026 20:16
0248345 to
6ca3952
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 does this PR do?
Adds a
versioncommand (with aversion checksubcommand) plus an inline, stderr-only "update available" notifier that runs before every command. The notifier fires only on interactive TTY runs, caches the npm registry dist-tag lookup on disk for 24h, and fails silently so it never touches stdout or the JSON contract that agents parse. It honorsNO_UPDATE_NOTIFIER,LINEARIS_NO_UPDATE_CHECK, andCI, and picks thelatest/nextrelease channel from the installed version.Closes #
Type of change
Checklist
Testing
Ran `npm run check:ci`, `npx tsc --noEmit`, and `npm test` — all pass. New unit tests in `tests/unit/common/update-notifier.test.ts` cover version comparison, channel selection, cache read/write, the disable env vars, and the notice formatting.
Notes for reviewers
The
preActionhook andprogram.parse()became async (parseAsync) so the notifier can await the registry lookup only when the cache is stale.