init
The cz init command helps you set up Commitizen in your project by creating a configuration file with your preferred settings.
Usage¶
Command¶
cz init
Interactive Configuration¶
When you run cz init, Commitizen will guide you through an interactive setup process:

Configuration File¶
The initialization process will create a configuration file in your project root.
See Configuration File for more details.
Configuration Options¶
During the initialization process, you'll be prompted to configure the following settings:
- Convention Rules: Select the commit message convention to follow (e.g., conventional commits)
- Version Provider: Choose how to manage versioning in your project. Commitizen supports multiple version management systems:
commitizen: Uses Commitizen's built-in version management systemnpm: Manages version inpackage.jsonfor Node.js projectscargo: Manages version inCargo.tomlfor Rust projectscomposer: Manages version incomposer.jsonfor PHP projectspep621: Usespyproject.tomlwith PEP 621 standardpoetry: Usespyproject.tomlwith Poetry configurationuv: Usespyproject.tomlanduv.lockfor Python projectsscm: Reads version directly from git tags without modifying files
- Project Version: The current version of your project will be detected automatically
- Tag Format: The format used for version tags in your repository
- Version Type: Choose between:
semverorsemver2: Semantic Versioning (MAJOR.MINOR.PATCH)pep440: Python Package Versioning
- Changelog Generation: Configure whether to automatically generate changelog during version bumps
- Alpha Versioning: Option to keep major version at 0 for alpha/beta software
- Pre-commit Hooks: Set up Git hooks for automated commit message validation. If neither
pre-commitnorprekis on PATH, the hook question is skipped. If you choose to install hooks, Commitizen uses whichever of those tools is available. If both are installed, you are asked which one to use.
See Configuration Options for more details.
Example¶
# Start the initialization process
cz init
# Follow the interactive prompts to configure your project
Next Steps¶
After initialization, you can:
- Start using
cz committo create conventional commits - Use
cz bumpto manage versioning - Configure additional settings in your project's configuration_file