Skip to content

mattn/bump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bump

Bump semantic version in any file using a regular expression pattern.

2026-02-18.091300.mp4

Inspired by gobump, but works with any file format.

Installation

go install github.com/mattn/bump@latest

Usage

bump (major|minor|patch|up|set <version>|show) -f <file> -p <pattern> [-w]

Commands

Command Description
major Bump major version up (e.g. 1.2.3 → 2.0.0)
minor Bump minor version up (e.g. 1.2.3 → 1.3.0)
patch Bump patch version up (e.g. 1.2.3 → 1.2.4)
up Bump up with interactive prompt
set <version> Set exact version (no increments)
show Only show the current version

Flags

Flag Description
-f <file> Target file (required)
-p <pattern> Regexp pattern with a capture group for the version (required)
-w Write result to file instead of stdout

Examples

package.json

{
  "name": "my-app",
  "version": "1.2.3"
}
bump patch -w -f package.json -p '"version":\s*"(\d+\.\d+\.\d+)"'

pyproject.toml

[project]
name = "my-app"
version = "1.2.3"
bump minor -w -f pyproject.toml -p 'version\s*=\s*"(\d+\.\d+\.\d+)"'

Cargo.toml

[package]
name = "my-app"
version = "1.2.3"
bump major -w -f Cargo.toml -p 'version\s*=\s*"(\d+\.\d+\.\d+)"'

Go source

const version = "1.2.3"
bump patch -w -f version.go -p 'version\s*=\s*"(\d+\.\d+\.\d+)"'

Interactive prompt

bump up -w -f package.json -p '"version":\s*"(\d+\.\d+\.\d+)"'

Set exact version

bump set 2.0.0 -w -f pyproject.toml -p 'version\s*=\s*"(\d+\.\d+\.\d+)"'

Show current version

bump show -f Cargo.toml -p 'version\s*=\s*"(\d+\.\d+\.\d+)"'

License

MIT

Author

mattn

About

Bump semantic version in any file using a regular expression pattern

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors