#semver #version #semantic #patch #version-string #minor #versioning

app semver-tool

A tool for validating and incrementing semver strings in scripts

1 unstable release

0.1.0 Feb 24, 2024

#4 in #minor

Custom license

106 lines



This tool is a wrapper around the rust semver library, so that its functionality can be available on the command line. It can increment the major, minor or patch numbers of a semver string, and perform comparisons on semver strings.


Manipulate semantic versioning numbers. It allows for a semantic version to be incremented by either
the major, minor, or patch number.

    semver-tool [SUBCOMMAND]

    -h, --help       Print help information
    -V, --version    Print version information

    --next-major    Increment the major version
                        Major version X (X.y.z | X > 0) MUST be incremented if any backward
                        incompatible changes are introduced to the public API. It MAY also include
                        minor and patch level changes. Patch and minor versions MUST be reset to 0
                        when major version is incremented.
    --next-minor    Increment the minor version
                        Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backward
                        compatible functionality is introduced to the public API. It MUST be
                        incremented if any public API functionality is marked as deprecated. It MAY
                        be incremented if substantial new functionality or improvements are
                        introduced within the private code. It MAY include patch level changes.
                        Patch version MUST be reset to 0 when minor version is incremented.
    --next-patch    Increment the patch version
                        Patch version Z (x.y.Z | x > 0) MUST be incremented if only backward
                        compatible bug fixes are introduced. A bug fix is defined as an internal
                        change that fixes incorrect behavior.
    compare         Compare two semantic versions.
                        Returns success if second value is greater, else fails.
    help            Print this message or the help of the given subcommand(s)
    init            Prints the first possible semantic version
    validate        Validates a semantic version.
                        Returns success if the version is valid as a semver string, else fails.


From crates.io

cargo install semver-tool


See https://github.com/patbeagan1/Open-Source-Requests


This project is licensed under The MIT License - see the LICENSE file for details.


~24K SLoC