Skip to content

CLI Reference ​

Without --config-file, the configuration file is searched for in the current directory and, inside a git or mercurial repository, each parent directory up to the repository root. See Configuration files.

File paths given on the command line are relative to the current working directory; absolute paths are used as-is. Paths in the configuration file are relative to the configuration file's directory. See How file paths are resolved.

bump-my-version ​

Version bump your Python project.

Usage

text
bump-my-version [OPTIONS] COMMAND [ARGS]...

Options

NameDescription
--versionShow the version and exit.
--helpShow this message and exit.

bump-my-version bump ​

Change the version.

ARGS may contain any of the following:

VERSION_PART is the part of the version to increase, e.g. minor. Valid values include those given in the --serialize / --parse option.

FILES are additional file(s) to modify. If you want to rewrite only files specified on the command line, use with the --no-configured-files option.

Usage

text
bump-my-version bump [OPTIONS] [ARGS]...

Options

NameDescription
--config-fileConfig file to read most of the variables from.
-v / --verbosePrint verbose logging to stderr. Can specify several times for more verbosity.
--allow-dirty / --no-allow-dirtyDon't abort if working directory is dirty, or explicitly abort if dirty.
--current-versionVersion that needs to be updated
--new-versionNew version that should be in the files
--toSet the VERSION_PART to this value instead of incrementing it. Use --new-version to replace the whole version.
--parseRegex parsing the version string
--serializeHow to format what is parsed back to a version
--searchTemplate for complete string to search
--replaceTemplate for complete string to replace
--regex / --no-regexTreat the search parameter as a regular expression or explicitly do not treat it as a regular expression.
--no-configured-filesOnly replace the version in files specified on the command line, ignoring the files from the configuration file.
--ignore-missing-files / --no-ignore-missing-filesIgnore any missing files when searching and replacing in files.
--ignore-missing-version / --no-ignore-missing-versionIgnore any Version Not Found errors when searching and replacing in files.
--dry-run / -nDon't write any files, just pretend.
--commit / --no-commitCommit to version control
--tag / --no-tagCreate a tag in version control
--push-tag / --no-push-tagPush the tag to the remote after creation (only works with --tag)
--sign-tags / --no-sign-tagsSign tags if created
--tag-nameTag name (only works with --tag)
--tag-messageTag message
-m / --messageCommit message
--commit-argsExtra arguments to commit command
--helpShow this message and exit.

Arguments

  • ARGS

bump-my-version replace ​

Replace the version in files.

FILES are additional file(s) to modify. If you want to rewrite only files specified on the command line, use with the --no-configured-files option.

Usage

text
bump-my-version replace [OPTIONS] [FILES]...

Options

NameDescription
--config-fileConfig file to read most of the variables from.
-v / --verbosePrint verbose logging to stderr. Can specify several times for more verbosity.
--allow-dirty / --no-allow-dirtyDon't abort if working directory is dirty, or explicitly abort if dirty.
--current-versionVersion that needs to be updated
--new-versionNew version that should be in the files. If not specified, it will be None.
--parseRegex parsing the version string
--serializeHow to format what is parsed back to a version
--searchTemplate for complete string to search
--replaceTemplate for complete string to replace
--regex / --no-regexTreat the search parameter as a regular expression or explicitly do not treat it as a regular expression.
--no-configured-filesOnly replace the version in files specified on the command line, ignoring the files from the configuration file.
--ignore-missing-versionIgnore any Version Not Found errors when searching and replacing in files.
--ignore-missing-filesIgnore any missing files when searching and replacing in files.
--dry-run / -nDon't write any files, just pretend.
--helpShow this message and exit.

Arguments

  • FILES

bump-my-version sample-config ​

Print a sample configuration file.

Usage

text
bump-my-version sample-config [OPTIONS]

Options

NameDescription
--prompt / --no-promptAsk the user questions about the configuration.
--destinationWhere to write the sample configuration.
--helpShow this message and exit.

bump-my-version show ​

Show current configuration information.

ARGS may contain one or more configuration attributes. For example:

  • bump-my-version show current_version

  • bump-my-version show files.0.filename

  • bump-my-version show scm_info.branch_name

  • bump-my-version show current_version scm_info.distance_to_latest_tag

Usage

text
bump-my-version show [OPTIONS] [ARGS]...

Options

NameDescription
--config-fileConfig file to read most of the variables from.
-f / --formatSpecify the output format.
-i / --incrementIncrement the version component and add new_version to the configuration.
--current-versionVersion that needs to be updated
--helpShow this message and exit.

Arguments

  • ARGS

bump-my-version show-bump ​

Show the possible versions resulting from the bump subcommand.

Usage

text
bump-my-version show-bump [OPTIONS] [VERSION]

Options

NameDescription
--config-fileConfig file to read most of the variables from.
--asciiUse ASCII characters only.
-v / --verbosePrint verbose logging to stderr. Can specify several times for more verbosity.
--helpShow this message and exit.

Arguments

  • VERSION