Skip to content

feat(cli): add passive update notifier and version command - #245

Merged
iamfj merged 1 commit into
nextfrom
conductor/iamfj-cli-update-notice
Jul 2, 2026
Merged

feat(cli): add passive update notifier and version command#245
iamfj merged 1 commit into
nextfrom
conductor/iamfj-cli-update-notice

Conversation

@iamfj

@iamfj iamfj commented Jul 2, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Adds a version command (with a version check subcommand) 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 honors NO_UPDATE_NOTIFIER, LINEARIS_NO_UPDATE_CHECK, and CI, and picks the latest/next release channel from the installed version.

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor (no behavior change)
  • Documentation
  • Tests
  • Build / CI

Checklist

  • `npm run check:ci` passes (lint + format)
  • `npx tsc --noEmit` passes (type check)
  • `npm test` passes (unit tests)
  • New code has tests (happy path + primary error case)
  • Commit messages follow Conventional Commits

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 preAction hook and program.parse() became async (parseAsync) so the notifier can await the registry lookup only when the cache is stale.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

✅ knip — no dead code

No unused files, exports, types, or dependencies detected.

@iamfj
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
iamfj force-pushed the conductor/iamfj-cli-update-notice branch from 0248345 to 6ca3952 Compare July 2, 2026 20:16
@iamfj
iamfj merged commit 02e2a3d into next Jul 2, 2026
12 checks passed
@iamfj
iamfj deleted the conductor/iamfj-cli-update-notice branch July 2, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant