Skip to content
Semver-cli

Semver-cli

Fast Semantic Versioning from the command line

Created on 3rd August 2026

•

Semver-cli

Semver-cli

Fast Semantic Versioning from the command line

The problem Semver-cli solves

The problem it solves
Managing software versions looks simple until prerelease tags, build metadata, sorting rules, and compatibility ranges become involved. Basic string comparison can produce incorrect results—for example, treating 1.0.0-beta.11 as lower than 1.0.0-beta.2.
SemVer CLI provides a fast and reliable way to work with Semantic Versioning 2.0 directly from the terminal. Developers can use it to:
Parse versions into major, minor, patch, prerelease, and build components.
Compare versions using correct semantic precedence instead of unsafe string comparison.
Sort stable and prerelease versions accurately.
Check whether a version satisfies npm-compatible caret and tilde ranges.
Validate version input before publishing packages or creating releases.
Automate version checks in scripts, release pipelines, and CI/CD workflows.
Built in Rust, it is lightweight, predictable, and resistant to malformed input. Its behavior is verified through 47 unit, integration, property-based differential, and range tests.
SemVer CLI makes release automation easier and safer by replacing custom version-handling logic with one tested command-line tool.

Challenges I ran into

Challenges I ran into
One of the biggest challenges was implementing Semantic Versioning precedence correctly. Versions cannot be compared as ordinary strings—for example, beta.11 must rank higher than beta.2, while build metadata must not affect precedence. I solved this by representing numeric and alphanumeric identifiers separately and testing the official SemVer ordering examples.
Prerelease range behavior was another difficult area. A range such as ^1.2.3 must reject prerelease versions by default, while ^1.2.3-alpha.1 may accept later prereleases only for the same major, minor, and patch version. I aligned the implementation with npm’s node-semver behavior and added dedicated caret, tilde, and prerelease tests.
I also encountered a missing Python semver dependency while running differential tests. This caused property tests to repeatedly reject cases instead of finishing normally. After installing the required module, I reran the complete optimized suite successfully.
To increase confidence beyond hand-written examples, I added property-based differential tests that compare the Rust implementation against Python SemVer across generated inputs. The final result passes all 47 unit, integration, differential, and range tests.

Discussion

Builders also viewed

See more projects on Devfolio