#semantic #version #calculator

bin+lib nextsv

Next semantic version calculator

18 releases (4 breaking)

0.7.9 Dec 21, 2022
0.7.4 Nov 19, 2022
0.4.0 Jul 31, 2022

#5 in #next-version

Download history 9/week @ 2023-11-03 46/week @ 2023-11-10 2/week @ 2023-11-17 36/week @ 2023-11-24 93/week @ 2023-12-01 18/week @ 2023-12-08 39/week @ 2023-12-15 36/week @ 2023-12-22 10/week @ 2023-12-29 1/week @ 2024-01-05 32/week @ 2024-01-19 18/week @ 2024-01-26 18/week @ 2024-02-02 67/week @ 2024-02-09 554/week @ 2024-02-16

657 downloads per month

MIT license

818 lines


Crates.io MIT licensed Build Status Rust 1.61+ FOSSA Status Docs BuyMeaCoffee GitHubSponsors

A utility to calculate the level of change and the next semantic version number based on the conventional commits since the last version tag.

Feature set

  • Calculate next semantic version number
  • Calculate the level to change for next semantic version number
  • Support basic semantic version components: Major, Minor, and Patch
  • Check for required files (e.g. CHANGELOG.md)
  • Set level of change (Breaking, Feature, Fix, Other) at which required files are required
  • Check that any changes made meet a specified level
  • Support pre-release versions (alpha, beta, rc)
  • Handle case where no tag is found
  • Update to release version (removing pre-release identifiers)

CLI Usage

Install the CLI using cargo install.

cargo install nextsv

Run in your project directory and check the version

$ nextsv --version
nextsv 0.7.9

Running the application provides the level for the next semantic version change.

$ nextsv
[2022-08-03T06:33:54Z INFO  nextsv] Calculating the next version level

Help provides all the options

$ nextsv -h
jerusdp <jrussell@jerus.ie>
Next semantic version calculator

    nextsv [OPTIONS]

    -f, --force <FORCE>      Force the calculation of the version number [possible values: major,
                             minor, patch, first]
    -h, --help               Print help information
        --level              Report the level of the version number change
        --number             Report the version number
    -p, --prefix <PREFIX>    Prefix string to identify version number tags [default: v]
    -q, --quiet              Pass many times for less log output
    -v, --verbose            Pass many times for more log output
    -V, --version            Print version information

A clean response of the level to update is reported using the -q flag.

$ nextsv -q

This can be used with cargo release to update and publish a new release.

cargo release $(nextsv -q)

Library Usage

To use the library add the crate to dependencies in the project's Cargo.toml.

nextsv = "0.7.9"


~400K SLoC