Key reference#

Every configuration key, with its type and default. Key names are written as they appear in a TOML file; the INI spelling is identical, only the section layout differs — see Config file formats.

Global keys#

These live in [tool.bumpversion] (TOML) or [bumpversion] (INI).

Version#

KeyTypeDefault
current_versionstring— (required in practice)
parseregex(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
serializestring or list["{major}.{minor}.{patch}"]

Search and replace#

KeyTypeDefault
searchtemplate{current_version}
replacetemplate{new_version}
regexboolfalse
ignore_missing_filesboolfalse
ignore_missing_versionboolfalse
no_configured_filesboolfalse

Paths#

KeyTypeDefault
included_pathslist of paths
excluded_pathslist of paths
additional_fileslist of paths

included_paths is a union, not a filter: it can add a path that no [[files]] entry produced.

Version control#

KeyTypeDefault
commitboolfalse
tagboolfalse
sign_tags (alias sign_tag)boolfalse
allow_dirtyboolfalse
dry_runboolfalse
message (alias commit_message)templateBump version: {current_version} → {new_version}
tag_nametemplatev{new_version}
tag_messagetemplateBump version: {current_version} → {new_version}
commit_argsstring

Hooks#

KeyTypeDefault
setup_hookslist of strings[]
pre_commit_hookslist of strings[]
post_commit_hookslist of strings[]

Per-file keys#

In a [[tool.bumpversion.files]] entry. Exactly one of filename and glob is required.

KeyTypeNotes
filenamestringA concrete path
globstringA glob pattern; case-insensitive
glob_excludestring or listOnly meaningful with glob; TOML only
parseregexOverrides the global value
serializestring or listOverrides the global value
searchtemplateOverrides the global value
replacetemplateOverrides the global value
regexboolOverrides the global value
ignore_missing_files (alias ignore_missing_file)boolOverrides the global value
ignore_missing_versionboolOverrides the global value

Only these keys are per-file. tag, commit, the hooks, and the message templates are global.

Per-component keys#

In [tool.bumpversion.parts.<name>], where <name> is a named capture group of parse.

KeyTypeNotes
valueslist of stringsAllowed values, in order. Without it the component is numeric
optional_valuestringValue that may be omitted when serializing
independentboolDo not reset when a higher component is bumped
first_valuestringThe value a reset goes to. Defaults to the first entry of values, or 0
always_incrementboolIncrement the component on every bump
depends_onstringThe component this one resets with
calver_formatstringReserved; CalVer formatting is not implemented

Placeholders#

Available in serialize, search, replace, tag_name, tag_message, and message.

Versions#

PlaceholderValue
{current_version}Version before the bump
{new_version}Version after the bump
{current_<part>}One per component — {current_major}, {current_minor}, …
{new_<part>}One per component — {new_major}, …

Inside a serialize pattern, the bare component names are also available: {major}, {minor}, {patch}, and any other capture group of parse.

Repository#

PlaceholderValue
{tool}Always git
{commit_sha}Current commit
{distance_to_latest_tag}Commits since the most recent tag
{current_tag}Most recent tag
{branch_name}Current branch
{short_branch_name}Branch name, shortened
{repository_root}Absolute path to the repository root
{dirty}true or false

Time and environment#

PlaceholderValue
{now}Local time, RFC 3339
{utcnow}UTC, RFC 3339
{$VAR}Any environment variable, prefixed with $ — for example {$CI_PIPELINE_ID}

{now} and {utcnow} accept a chrono format after a colon:

tag_name = "nightly-{utcnow:%Y%m%d}"

Escapes#

PlaceholderValue
{#}A literal #
{;}A literal ;

These exist because # and ; start a comment in INI files. Write {{ and }} for literal braces.

An unknown placeholder is an error, not an empty string — a typo in a template fails the run rather than silently producing a wrong tag.

Environment variables#

Every command-line flag has a matching environment variable, named BUMPVERSION_ plus the flag in upper snake case — --dry-run is BUMPVERSION_DRY_RUN, --tag-name is BUMPVERSION_TAG_NAME. The full list is in the CLI reference.