Skip to content

[FEATURE] Support npm version --interactive #810

@pacexy

Description

@pacexy

Why

Version bumping in npm currently requires explicitly specifying the version increment (e.g. npm version minor). This makes it challenging to create reusable release scripts in package.json, as the version increment needs to be hardcoded or passed as an argument.

How

Current Behavior

npm version minor  # Must specify version increment explicitly

Expected Behavior

Would like to add an interactive mode similar to bumpp:

{
  "scripts": {
    "release": "npm version --interactive"
  }
}

Running npm run release would present an interactive CLI prompt:

? Current version 0.1.0 »
            major 1.0.0
            minor 0.2.0
            patch 0.1.1
>            next 0.1.1
        pre-patch 0.1.1-beta.0
        pre-minor 0.2.0-beta.0
        pre-major 1.0.0-beta.0
            as-is 0.1.0
           custom ...

Benefits:

  • More intuitive version selection
  • Reusable release scripts without hardcoding versions

This would align npm's version bumping workflow with modern CLI tools while maintaining compatibility with existing npm version commands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions