Skip to content

Auto Version Checking & Update Prompt for New Releases #26

@utkarsh232005

Description

@utkarsh232005

Summary

KDM should automatically check whether a newer version of the CLI is available and notify users when they are running an outdated version.

This feature will help users stay updated with the latest improvements, bug fixes, security patches, and newly introduced features without manually checking npm releases.


Problem

Currently, users have no visibility into whether:

  • A newer version of KDM is available
  • Their installed version is outdated
  • Important fixes or breaking changes exist in newer releases

As a result:

  • Users may continue using deprecated or buggy versions
  • Support/debugging becomes harder due to version mismatches
  • New features remain undiscovered
  • Critical fixes may not reach users quickly

Proposed Solution

Implement automatic version checking whenever the CLI starts or when a command is executed.

The CLI should:

  1. Detect the currently installed version
  2. Compare it with the latest published npm version
  3. Notify the user if an update is available
  4. Provide a direct update command

Example Behavior

User Running Older Version

kdm monitor

Output:

A newer version of KDM is available!

Current Version : v2.1.2
Latest Version  : v2.2.0

Update using:
npm install -g kdm-cli@latest

Suggested Features

Silent Background Version Check

  • Perform lightweight version checks asynchronously
  • Avoid slowing down command execution
  • Cache results temporarily to reduce unnecessary API calls

Smart Notification System

  • Show update prompts only once per session/day
  • Avoid spamming users on every command
  • Highlight major or breaking updates separately

Semantic Version Awareness

Different messages for:

  • Patch updates (2.1.2 → 2.1.3)
  • Minor updates (2.1.2 → 2.2.0)
  • Major updates (2.x → 3.x)

Optional Flags

Examples:

kdm --version
kdm update check
kdm update

Additional Enhancements

  • Add release notes link in update prompt
  • Add auto-update support in future
  • Allow users to disable update notifications
  • Add update status inside kdm doctor
  • Show changelog summary for major releases

Benefits

  • Keeps users on supported versions
  • Improves overall CLI reliability
  • Reduces issue reports caused by outdated builds
  • Faster adoption of new features
  • Better developer and user experience
  • More professional CLI ecosystem

Suggested Implementation

Possible approaches:

  • Use npm registry version checks
  • Compare package.json version with latest npm release
  • Use lightweight update notifier libraries
  • Cache checks locally for performance optimization

Expected Outcome

Users should automatically receive a clean and non-intrusive notification whenever a newer KDM version is available, along with a direct command to upgrade easily.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions