A semantic version management CLI tool that manages versions in a plain text VERSION file.
Documentation: https://benjaminabbitt.github.io/versionator/
- Single source of truth: Plain text VERSION file
- SemVer 2.0.0 compliant: Full support for pre-release and build metadata
- Deliberate version control: Explicit
major/minor/patchcommands for teams who prefer manual versioning - Auto-bump available: Optional commit message parsing via
bumpcommand (+semver: tags or Conventional Commits) - Code embedding: Generate version constants for 10+ languages
- CI/CD integration: Output version variables for GitHub Actions, GitLab CI, etc.
- Git integration: Create tags and release branches
Generate version constants for your codebase (sorted by TIOBE Index):
| Language | Format | Documentation |
|---|---|---|
| Python | python |
_version.py |
| C | c, c-header |
version.c, version.h |
| C++ | cpp, cpp-header |
version.cpp, version.hpp |
| Java | java |
Version.java |
| C# | csharp |
Version.cs |
| JavaScript | js |
version.js |
| Go | go |
version.go |
| TypeScript | ts |
version.ts |
| PHP | php |
Version.php |
| Swift | swift |
Version.swift |
| Kotlin | kotlin |
Version.kt |
| Rust | rust |
version.rs |
| Ruby | ruby |
version.rb |
Data formats: JSON (json), YAML (yaml) — see emit command
Container files: Docker — Containerfile/Dockerfile with OCI labels
Full documentation: https://benjaminabbitt.github.io/versionator/
# Linux (x64)
curl -LO https://github.com/benjaminabbitt/versionator/releases/latest/download/versionator-linux-amd64.tar.gz
tar xzf versionator-linux-amd64.tar.gz
sudo mv versionator-linux-amd64 /usr/local/bin/versionator
# Or use container (Docker/Podman)
docker run --rm -v $(pwd):/workspace ghcr.io/benjaminabbitt/versionator versionSee Installation for all platforms.
versionator init # Create VERSION file (0.0.1)
versionator patch + # 0.0.1 -> 0.0.2 (aliases: increment, inc, +)
versionator release # Create tag v0.0.2Versionator is a hobby project solving a real problem. It could be solved with less—a regex parses most version strings just fine. Instead, there's a 370-line formal EBNF grammar covering SemVer, Go pseudo-versions, .NET assembly versions, and more. Written on a Sunday afternoon because formal grammars are fun and passion projects permit glorious digressions.
The grammar might have value to someone, sometime. If it doesn't, that's fine too. It has value to me.
See Grammar-Based Parser for the full philosophy.
BSD-3-Clause