CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-update-notifier

Update notifications for your CLI app

Overall
score

97%

Overview
Eval results
Files

task.mdevals/scenario-8/

CLI Version Checker

Build a lightweight command-line tool that checks if a newer version of itself is available and displays appropriate update notifications to users.

Requirements

Your tool should:

  1. Check for updates non-intrusively without blocking the main application flow
  2. Display a formatted notification box when an update is available, showing the current version, latest version, and update command
  3. Cache update check results to avoid redundant network calls
  4. Respect different runtime environments (automatically disable in CI/test environments)
  5. Allow users to opt-out of update notifications

Implementation Details

Create a CLI application with the following behavior:

  • The tool should have a name and version specified in package.json
  • On each run, it should check if a newer version is available (respecting check intervals)
  • When an update is available, display a styled notification box with version information
  • The notification should appear after the main program output for a cleaner user experience
  • Support both global and local installation contexts with appropriate update commands

Test Cases

  • When run with an outdated version, it displays an update notification @test
  • When the NO_UPDATE_NOTIFIER environment variable is set, no update check occurs @test
  • When running in a CI environment (CI=true), no update notification is shown @test

Implementation

@generates

API

#!/usr/bin/env node

/**
 * Main CLI entry point that performs update checking
 * and displays notifications when updates are available.
 */

Dependencies { .dependencies }

update-notifier { .dependency }

Provides non-intrusive update notifications for CLI applications with zero performance impact through background checking.

Install with Tessl CLI

npx tessl i tessl/npm-update-notifier

tile.json