Version providers are the mechanism by which Commitizen reads and writes version information in your project.
They abstract away the details of where and how version numbers are stored, allowing Commitizen to work seamlessly with different project types and package management systems.
By default, Commitizen uses the commitizen provider, which stores the version in your Commitizen configuration file. However, you can configure Commitizen to use any available provider that matches your project's setup. This is particularly useful when you want Commitizen to manage versions in the same location as your package manager (e.g., package.json for Node.js projects, pyproject.toml for Python projects).
Commitizen includes several built-in version providers for common package management formats:
The default version provider stores and retrieves the version from your Commitizen configuration file (e.g., pyproject.toml, .cz.toml, etc.).
Use when:
Configuration:
Fetches the version from Git tags using git describe. This provider only reads version information and never writes it back to files. It's designed to work with tools like setuptools-scm or other package manager *-scm plugins that derive version numbers from Git history.
Use when:
Configuration:
Note
The scm provider is read-only. When you run cz bump, it will create a Git tag but won't update any files. This is intentional and works well with tools that derive versions from Git tags.
Manages version in pyproject.toml under the project.version field, following PEP 621 standards.
Use when:
Configuration:
Example pyproject.toml:
Manages version in pyproject.toml under the tool.poetry.version field, which is used by the Poetry package manager. This approach is recommended only for users running Poetry versions earlier than 2.0 or relying on Poetry-specific features. For most users on Poetry 2.0 or later, it is recommended to use pep621 instead. Read More
Use when:
Configuration:
Example pyproject.toml:
Manages version in both pyproject.toml (project.version) and uv.lock (package.version for the matching package name). This ensures consistency between your project metadata and lock file.
Note
Even though uv follows PEP 621 format, pep621 does not manage the version in uv.lock. uv is still suggested for uv users.
Use when:
Configuration:
Manages version in both Cargo.toml (package.version) and Cargo.lock (package.version for the matching package name). This ensures consistency between your Rust project's manifest and lock file.
Use when:
Configuration:
Example Cargo.toml:
Manages version in package.json and optionally synchronizes with package-lock.json and npm-shrinkwrap.json if they exist.
Use when:
Configuration:
Example package.json:
Manages version in composer.json under the version field, used by PHP's Composer package manager.
Use when:
Configuration:
Example composer.json:
| commitizen | Commitizen config file | No | General use, flexible projects |
| scm | None (reads from Git tags) | Yes | setuptools-scm users |
| pep621 | pyproject.toml (project.version) | No | Modern Python (PEP 621) |
| poetry | pyproject.toml (tool.poetry.version) | No | Poetry projects |
| uv | pyproject.toml + uv.lock | No | uv package manager |
| cargo | Cargo.toml + Cargo.lock | No | Rust/Cargo projects |
| npm | package.json (+ lock files) | No | Node.js/npm projects |
| composer | composer.json | No | PHP/Composer projects |
If none of the built-in providers meet your needs, you can create a custom version provider by extending the VersionProvider base class and registering it as a plugin.
Create a Python file (e.g., my_provider.py) that extends VersionProvider:
Register your provider using the commitizen.provider entry point. You can do this in your setup.py, setup.cfg, or pyproject.toml:
Using pyproject.toml (recommended):
Using setup.py (for legacy setup):
Install your provider package:
Once your custom Commitizen provider is packaged and published (for example, to PyPI), install it like any standard Python package:
If you want to use the provider directly from the current project source (during development), install it in editable mode (See pip documentation):
Configure Commitizen to use your provider:
When creating a custom provider, keep these guidelines in mind:
Here's a more complete example using the JsonProvider base class:
This example leverages the JsonProvider base class, which handles file reading, writing, and JSON parsing automatically.
Select a version provider based on your project's characteristics:
Remember that you can always use version_files in combination with any provider to update additional files during version bumps, regardless of which provider you choose for reading/writing the primary version.
April 5, 2026