Skip to main content

Binary distribution for semverctl

Project description

semverctl

Go Report Card lint test codecov version npm PyPI license

CLI for bumping and setting SemVer values in JSON/YAML files

Features

  • Semantic Versioning - Strict SemVer 2.0.0 compliance with prerelease and build metadata support
  • 📁 Multiple Formats - JSON and YAML file support
  • 🎯 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
  • 🌐 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

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

Usage

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.

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 - Success
  • 1 - Error (invalid arguments, file not found, parse error, etc.)

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

semverctl-0.0.10-py3-none-win_amd64.whl (3.7 MB view details)

Uploaded Python 3Windows x86-64

semverctl-0.0.10-py3-none-manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded Python 3

semverctl-0.0.10-py3-none-manylinux2014_aarch64.whl (3.5 MB view details)

Uploaded Python 3

semverctl-0.0.10-py3-none-macosx_11_0_arm64.whl (3.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

semverctl-0.0.10-py3-none-macosx_10_13_x86_64.whl (3.6 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

File details

Details for the file semverctl-0.0.10-py3-none-win_amd64.whl.

File metadata

  • Download URL: semverctl-0.0.10-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","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}

File hashes

Hashes for semverctl-0.0.10-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9e5766e69b1210cd9f9ea7b21493a42a0f5b5b8c7048f60081ea2b466a4c918b
MD5 1502b8afb846a9057a18d05358e173f6
BLAKE2b-256 6f397409d071ca81a0d09d2b4134fe5d14db76933a50202c5ba1275fc996298b

See more details on using hashes here.

File details

Details for the file semverctl-0.0.10-py3-none-manylinux2014_x86_64.whl.

File metadata

  • Download URL: semverctl-0.0.10-py3-none-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","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}

File hashes

Hashes for semverctl-0.0.10-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 536762557ec1c6357fbbcea15a36a88e2a4c643263bace2189b7e4e79cc0ef91
MD5 df395bf5d2c19064767d5bdaa7f4dff4
BLAKE2b-256 c09dc1527264a4e81c9668465b4c438faf0d688424472a71e619899e8985982d

See more details on using hashes here.

File details

Details for the file semverctl-0.0.10-py3-none-manylinux2014_aarch64.whl.

File metadata

  • Download URL: semverctl-0.0.10-py3-none-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","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}

File hashes

Hashes for semverctl-0.0.10-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b2e1dfb6555497490abf192d1931886dd4ba41e46c7939723a0f2be2e4348d61
MD5 0ef7b93ec680c4b2b8d2afe91d022c9a
BLAKE2b-256 76a154495d4b946f141ab9cbcc95790d2cffbe7cc81836d0cbbb64e8a09bf6de

See more details on using hashes here.

File details

Details for the file semverctl-0.0.10-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: semverctl-0.0.10-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","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}

File hashes

Hashes for semverctl-0.0.10-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 14ae93cd0fb65954b249e60eade70ce637cdf88adcf786251c321c5eac47e0f1
MD5 a7467648084a01d6254febaa8c6b460f
BLAKE2b-256 838ba6ee03fd91c06fc3401020ec8828c2790967863d0fe1cef1d5ab6092acc1

See more details on using hashes here.

File details

Details for the file semverctl-0.0.10-py3-none-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: semverctl-0.0.10-py3-none-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: Python 3, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","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}

File hashes

Hashes for semverctl-0.0.10-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 88cda8fb6a15e980fbfe5cb2d3c78c7e4ff752035d9c8516ff2d35d8de5f333f
MD5 cb57faac01deb4961c505a8a1bf9bcaf
BLAKE2b-256 3b3b6e2348fe21017cffcfa5fa49e7a549facccc7687658a8d347dfe85dea5c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page