Skip to content

feat: add update notification to CLI for available package updates#10

Merged
smoratino-apogea merged 1 commit into
mainfrom
feature/add-update-notification-to-cli
Apr 6, 2026
Merged

feat: add update notification to CLI for available package updates#10
smoratino-apogea merged 1 commit into
mainfrom
feature/add-update-notification-to-cli

Conversation

@smoratino-apogea

Copy link
Copy Markdown
Contributor

Add update notification to CLI

Description:

Summary

Adds a non-blocking update notifier to the thatopen CLI. When an outdated version is installed, users will see a notice at the end of any command's output prompting them to update.

What changed

  • On every CLI invocation, a background fetch request checks the latest published version of thatopen-services on the npm registry.
  • If the installed version differs from the latest, a warning message is printed after the command completes (via process.on('exit')), so it never interrupts normal output.
  • The request has a 3-second timeout (AbortSignal.timeout) and fails silently — no network access or registry errors will ever affect CLI behaviour.

Example output

  ⚠ Update available: 0.12.0 → 0.13.1
  Run "npm install -g thatopen-services@latest" to update.

Notes

  • No new dependencies added.
  • Uses native fetch (available since Node 18+).
  • Version comparison is a simple string equality check. Since the CLI is a globally installed tool and this only compares the published latest tag, this is sufficient for the intended use case.

@smoratino-apogea smoratino-apogea merged commit 781137f into main Apr 6, 2026
1 check passed
@agviegas agviegas deleted the feature/add-update-notification-to-cli branch June 4, 2026 21:52
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.

2 participants