bump2v
A CLI wrapper and native fork of bump2version for automated semantic versioning. Bumps version numbers across files, commits, tags, and pushes – all in one command.
pip install bump2v
How it works
bump2v reads your current version from a config file, increments it, rewrites it in every file you specify, commits the change, creates a git tag, and pushes – all in one command. The source of truth for the version lives in your project’s main file:
Node.js / React / JS – package.json -> "version": "1.0.0"
Python – appInfo.py -> __version__ = "1.0.0"
Any other file – configurable via .bumpversion.cfg
The .bumpversion.cfg file tells bump2v where to find and update that version string. You only need to run bump2v – never edit the version manually.
Quick Start
Step 1: Make your code change.
Step 2: Stage and commit.
git add .
git commit -m "fix: describe your change here"
Step 3: Bump the version and push.
bump2v patch # 1.0.0 -> 1.0.1 (bug fix)
bump2v minor # 1.0.0 -> 1.1.0 (new feature)
bump2v major # 1.0.0 -> 2.0.0 (breaking change)
bump2v auto # detect level from commit messages automatically
Alternative command aliases: bumptydumpty, versionkaboom
Preview first
bump2v patch --dry-run # shows the new version; writes, commits and pushes nothing
bump2v patch --dry-run --verbose # also shows each file it would change
bump2v pushes only what the run itself created. With --dry-run, --no-commit or commit = False there is nothing new, so nothing is pushed.
Setup by project type
Node.js / React
The version lives in package.json. bump2v finds and updates it there.
.bumpversion.cfg:
[bumpversion]
current_version = 1.0.0
commit = True
tag = True
message = Version Updated: {current_version} -> {new_version} [skip ci]
[bumpversion:file:package.json]
search = "version": "{current_version}"
replace = "version": "{new_version}"
The current_version in .bumpversion.cfg must always match the "version" field in package.json. bump2v keeps them in sync automatically – never edit either one by hand.
Python
The version lives in appInfo.py (or wherever you store your app metadata).
app/appInfo.py:
app_name = "Your App Name"
__version__ = "1.0.0"
description = "Describe your app here"
main.py:
from appInfo import __version__, app_name, description
app = FastAPI(
title=app_name,
description=description,
version=__version__,
)
.bumpversion.cfg:
[bumpversion]
current_version = 1.0.0
commit = True
tag = True
message = Version Updated: {current_version} -> {new_version} [skip ci]
[bumpversion:file:app/appInfo.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"
Multiple files
You can target as many files as needed:
[bumpversion]
current_version = 1.0.0
commit = True
tag = True
[bumpversion:file:package.json]
search = "version": "{current_version}"
replace = "version": "{new_version}"
[bumpversion:file:app/appInfo.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"
Semantic Versioning
bump2v patch – 1.0.0 -> 1.0.1 – Bug fixes, minor improvements
bump2v minor – 1.0.0 -> 1.1.0 – New backward-compatible features
bump2v major – 1.0.0 -> 2.0.0 – Breaking changes
bump2v auto – Detect level automatically from commit messages
Auto mode (Conventional Commits)
bump2v auto analyzes every commit since the last git tag using the Conventional Commits spec and selects the bump level automatically. No more guessing whether this week’s work is a patch or a minor.
Rules:
feat!: or BREAKING CHANGE: in commit footer -> major
feat: -> minor
fix:, perf:, refactor:, chore:, docs:, etc. -> patch
Scopes are supported: feat(auth): counts as feat
The highest level found across all commits wins
Example output:
$ bump2v auto
Analyzing commits since v1.5.3...
feat: add websocket endpoint minor
fix: handle null pointer in auth module patch
chore: update dependencies patch
feat!: redesign configuration API MAJOR
Auto-detected: major
Bumping to version: 2.0.0
If no conventional commits are found, bumps patch as a safe fallback. If there are no commits since the last tag, bump2v exits without bumping.
Advanced Flags
--tag-only – Tag without bumping
Tags the current HEAD using current_version from config, without bumping or committing. Useful when you need to commit a build artifact between the version bump commit and the release tag.
bump2v patch --no-tag # bump + commit, skip the tag
# ... build artifact, git add, git commit ...
bumpversion --tag-only # tag HEAD now
Fixes #256.
--ignore-missing-version – Skip files without a version string
When using glob patterns, some files may not contain the version string. Instead of crashing, bump2v logs a warning and skips those files.
bump2v patch --ignore-missing-version
Or set it permanently in config:
[bumpversion]
ignore_missing_version = True
Fixes #267.
--extra-files – Include generated files in the bump commit
Stage additional files alongside the version bump commit, even if not modified by bumpversion. Files can be dirty or untracked.
bump2v patch --extra-files docs/changelog.md dist/summary.txt
Or set them in config:
[bumpversion]
extra_files = docs/changelog.md dist/summary.txt
Fixes #259.
Full Config Reference
[bumpversion]
current_version = 1.0.0
commit = True
tag = True
sign_tags = False
message = Version Updated: {current_version} -> {new_version} [skip ci]
tag_name = v{new_version}
tag_message = Release {new_version}
commit_args =
ignore_missing_version = False
extra_files =
[bumpversion:file:package.json]
search = "version": "{current_version}"
replace = "version": "{new_version}"
Tips
Remove all local tags if you need to reset:
git tag -l | xargs -n 1 git tag -d
Contributors
Maintained and extended by @maimul.
Built on top of bump2version by Christian Verkerk.
Metadata
Release files for bump2v 1.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bump2v-1.6.2-py3-none-any.whl | Python 3 | none | any | Details for bump2v-1.6.2-py3-none-any.whl |
Release files / bump2v-1.6.2-py3-none-any.whl
| Download URL | bump2v-1.6.2-py3-none-any.whl |
|---|---|
| Size | 22.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
423660be9d9f744567e1c57fdeaa30b8cf7385159e306fe14cebab558ecfda7a
|
|
BLAKE2b-256 checksum How to use checksums |
9f271086da1ffec1f042a29811f90aee277e7a43dbd2750fd4fd21021314f761
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Security for bump2v 1.6.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.