semverctl
CLI for bumping and setting SemVer values in JSON/YAML files and Git tags
Features
- ✨ Semantic Versioning - Strict SemVer 2.0.0 compliance with prerelease and build metadata support
- 📁 File + Tag Workflows - Explicit
bump/set fileandbump/set tagcommands - 🏷️ Git Tag Releases - Bump from latest stable
vX.Y.Ztag or set explicit tags - 🎯 Path Navigation - Dot-notation paths for nested version fields (e.g.,
.app.version) - 🔢 Numeric Bumping - Bump individual numeric fields for object-style versions
- 🧪 Dry-Run Mode - Preview changes with unified diff output
- 🤖 Automation-Friendly JSON -
--jsonoutput for machine-readable success/error payloads - 🔒 Safety Checks - Tag operations require a clean repository state
- 🌐 Cross-Platform - Linux, macOS, and Windows support (CGO-free)
- ⚡ Zero Dependencies - Pure Go implementation with no runtime dependencies
- 📦 Multiple Distribution Channels - Go install, npm, uv/PyPI, and GitHub Releases
Usage
Quickstart
# Install globally
npm i -g @metalagman/semverctl@latest
# Bump patch version in package.json
semverctl bump file package.json
# Bump minor version in Helm Chart.yaml
semverctl bump file Chart.yaml --minor
# Create a new git tag for the next release
semverctl bump tag --push
Node.js (package.json)
# Bump patch in package.json
semverctl bump file package.json
# Bump major version for a breaking change
semverctl bump file package.json --major
# Preview what would change without modifying the file
semverctl bump file package.json --minor --dry-run
Helm (Chart.yaml)
Helm Charts have two version fields: version (the chart version) and appVersion (the version of the application contained in the chart).
# Bump the Chart version (default .version path)
semverctl bump file Chart.yaml --patch
# Bump the appVersion explicitly
semverctl bump file Chart.yaml --minor --path appVersion
# Preview Helm chart changes
semverctl bump file Chart.yaml --major --dry-run
Git Tags
Create and push tags for your releases.
# Create and push the next patch tag (e.g., v1.0.1)
semverctl bump tag --push
# Create the next minor tag (e.g., v1.1.0) without pushing
semverctl bump tag --minor
# Preview tag creation
semverctl bump tag --major --dry-run
CLI Reference
Bump File Version
Bump the semantic version in a specific JSON or YAML file:
# Bump patch in a file
semverctl bump file package.json
# Bump specific version component
semverctl bump file package.json --minor
semverctl bump file package.json --major
# Bump version at a custom path
semverctl bump file config.yaml --path .app.version
# Preview changes without modifying the file
semverctl bump file package.json --dry-run
# Machine-readable output for automation
semverctl bump file package.json --dry-run --json
Set File Version
Set an explicit version value in a specific file:
# Set version to 1.2.3 in a file
semverctl set file 1.2.3 package.json
# Set version at a custom path
semverctl set file 2.0.0 config.yaml --path .app.version
# Preview changes
semverctl set file 1.0.0 package.json --dry-run
# Machine-readable output for automation
semverctl set file 1.2.3 package.json --json
Bump Tag
Bump from the latest stable git tag (vX.Y.Z) and create a new annotated tag:
# Create next patch tag
semverctl bump tag
# Create next minor tag
semverctl bump tag --minor
# Preview tag creation
semverctl bump tag --dry-run
# Create and push tag to origin
semverctl bump tag --push
# Machine-readable output for automation
semverctl bump tag --dry-run --json
Set Tag
Create an explicit annotated git tag:
# Accepts 1.2.3 or v1.2.3
semverctl set tag 1.2.3
semverctl set tag v2.0.0
# Preview tag creation
semverctl set tag 2.1.0 --dry-run
# Create and push tag to origin
semverctl set tag 2.1.0 --push
# Machine-readable output for automation
semverctl set tag 2.1.0 --json
Numeric Bump
For object-style version fields (e.g., { "Major": 1, "Minor": 2, "Patch": 3 }),
you can bump numeric scalar values:
semverctl bump file config.json --numeric --path .version.Patch
This increments the numeric value at the specified path by 1.
Installation
Go
go install github.com/metalagman/semverctl/cmd/semverctl@latest
npm (Node.js)
npx @metalagman/semverctl version
# Or install globally
npm install -g @metalagman/semverctl
semverctl version
uv/Pip (Python)
uvx semverctl version
# Or install
uv pip install semverctl
semverctl version
Pre-built Binaries
Download pre-built binaries from GitHub Releases:
# Linux/macOS
curl -L https://github.com/metalagman/semverctl/releases/latest/download/semverctl-linux-amd64 -o semverctl
chmod +x semverctl
sudo mv semverctl /usr/local/bin/
# Verify checksum (recommended)
curl -L https://github.com/metalagman/semverctl/releases/latest/download/checksums.txt -o checksums.txt
sha256sum -c checksums.txt
Path Syntax
Paths use dot notation to navigate nested structures:
.version- Top-level version field.app.version- Nested version field.package.version- Deeply nested field
The leading dot is optional: version and .version are equivalent.
File Formats
Supported formats:
- JSON (
.json) - YAML (
.yaml,.yml)
Strict SemVer
semverctl follows the Semantic Versioning 2.0.0 specification:
- Versions must be in format
MAJOR.MINOR.PATCH - Prerelease and build metadata are supported:
1.0.0-alpha+build.123 - Leading zeros are not allowed in numeric components
- When bumping, prerelease and build metadata are cleared
Dry-Run Mode
Use --dry-run to preview file changes or tag actions without mutation:
semverctl bump file package.json --dry-run
semverctl bump tag --dry-run
For file commands, this outputs a unified diff showing what would change.
JSON Output
Use --json for machine-readable automation output:
semverctl bump tag --dry-run --json
semverctl set tag 1.2.3 --json
semverctl bump file package.json --dry-run --json
When --json is enabled, both success and failure responses are printed as JSON to stdout.
Failures still return a non-zero exit code.
Exit Codes
0- Success1- Error (invalid arguments, file not found, parse error, etc.)
License
MIT License - see LICENSE file for details.
Metadata
Release files for semverctl 0.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| semverctl-0.0.12-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| semverctl-0.0.12-py3-none-manylinux2014_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| semverctl-0.0.12-py3-none-manylinux2014_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| semverctl-0.0.12-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| semverctl-0.0.12-py3-none-macosx_10_13_x86_64.whl | Python 3 | none | macOS 10.13+ x86-64 | Details |
Total release size: 17.9 MB
Release files / semverctl-0.0.12-py3-none-win_amd64.whl
| Download URL | semverctl-0.0.12-py3-none-win_amd64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
17dd3518074821b43978021fc701c18b4275c1e6fefe45d66709c59651f7b75a
|
|
BLAKE2b-256 checksum How to use checksums |
11996a1386c6f8f41b0ac9e1ec7fc5fc4601c7ffce628610a43457ec0d699dcb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / semverctl-0.0.12-py3-none-manylinux2014_x86_64.whl
| Download URL | semverctl-0.0.12-py3-none-manylinux2014_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
7316733fb474d30e6a5bf0aa08828086f685111661e9846e221f8e4a91904024
|
|
BLAKE2b-256 checksum How to use checksums |
b9ac61d9439b4ba63dbb3d34a975d08c9161d304ba8e43df3c9acb7ecd76713a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / semverctl-0.0.12-py3-none-manylinux2014_aarch64.whl
| Download URL | semverctl-0.0.12-py3-none-manylinux2014_aarch64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
2ae3963df1001c4fd92595fb01c9274162eb110d75f5df00ec5f222d69df6369
|
|
BLAKE2b-256 checksum How to use checksums |
fcbd6a1af06a14de8e68cc6960ae2ac7d442b3f151e01e36998edc18f27d855a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / semverctl-0.0.12-py3-none-macosx_11_0_arm64.whl
| Download URL | semverctl-0.0.12-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
06ce86fccc8d32d69326d14d86bb4d27095a15975bec78faa49ec79439aec8dc
|
|
BLAKE2b-256 checksum How to use checksums |
3650c6cf52b15f46ce3bec723d85ab28d4ee130eb0f055e4e2a332012b4fc049
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / semverctl-0.0.12-py3-none-macosx_10_13_x86_64.whl
| Download URL | semverctl-0.0.12-py3-none-macosx_10_13_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | Python 3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
bef51168f6ae772655a50a25e10ae2de5fe143ead6078ae72d6c649d1f5e7818
|
|
BLAKE2b-256 checksum How to use checksums |
72cdc3c3a398754b980044d3e938bc31a291b4aa7df19ce389b898c92bc398f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|