versionator

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

README

Versionator

A semantic version management CLI tool that manages versions in a plain text VERSION file.

Documentation: https://benjaminabbitt.github.io/versionator/

Features

  • 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/patch commands for teams who prefer manual versioning
  • Auto-bump available: Optional commit message parsing via bump command (+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

Language Support

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

Documentation

Full documentation: https://benjaminabbitt.github.io/versionator/

Quick Install

# 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 version

See Installation for all platforms.

Quick Start

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.2

About This Project

Versionator 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.

License

BSD-3-Clause

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cmd messages - error and log message constants Exported so tests can compare against them
Package cmd messages - error and log message constants Exported so tests can compare against them
docs
grammar/railroad command
Command railroad generates railroad diagrams from the version parser grammar.
Command railroad generates railroad diagrams from the version parser grammar.
examples
go command
internal
ci
config
Package config messages - error and log message constants Exported so tests can compare against them
Package config messages - error and log message constants Exported so tests can compare against them
emit
Package emit messages - error and log message constants Exported so tests can compare against them
Package emit messages - error and log message constants Exported so tests can compare against them
parser
Package parser provides a grammar-based version string parser using participle.
Package parser provides a grammar-based version string parser using participle.
vcs
vcs/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
version
Package version messages - error and log message constants Exported so tests can compare against them
Package version messages - error and log message constants Exported so tests can compare against them

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL