Skip to content

Commit c946c19

Browse files
committed
docs(init): rewrite commands init page
1 parent aaa64ac commit c946c19

File tree

1 file changed

+52
-17
lines changed

1 file changed

+52
-17
lines changed

docs/commands/init.md

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,62 @@
1-
## Usage
1+
The `cz init` command helps you set up Commitizen in your project by creating a configuration file with your preferred settings.
22

3-
![cz init --help](../images/cli_help/cz_init___help.svg)
4-
5-
## Example
6-
7-
To start using Commitizen, the recommended approach is to run
3+
## Command
84

95
```sh
106
cz init
117
```
128

9+
## Interactive Configuration
10+
11+
When you run `cz init`, Commitizen will guide you through an interactive setup process:
12+
1313
![init](../images/init.gif)
1414

15-
This command will ask you for information about the project and will
16-
configure the selected file type (`pyproject.toml`, `.cz.toml`, etc.).
15+
## Configuration File
16+
17+
The initialization process will create a configuration file in your project root.
18+
19+
Choose the configuration file format based on your project type:
20+
21+
- Use `pyproject.toml` for Python projects
22+
- Use `.cz.toml`, `.cz.yaml`, `.cz.json`, etc. for other projects.
23+
24+
## Configuration Options
25+
26+
During the initialization process, you'll be prompted to configure the following settings:
27+
28+
1. **Convention Rules**: Select the commit message convention to follow (e.g., conventional commits)
29+
2. **Version Provider**: Choose how to manage versioning in your project. Commitizen supports multiple version management systems:
30+
- `commitizen`: Uses Commitizen's built-in version management system
31+
- `npm`: Manages version in `package.json` for Node.js projects
32+
- `cargo`: Manages version in `Cargo.toml` for Rust projects
33+
- `composer`: Manages version in `composer.json` for PHP projects
34+
- `pep621`: Uses `pyproject.toml` with PEP 621 standard
35+
- `poetry`: Uses `pyproject.toml` with Poetry configuration
36+
- `uv`: Uses `pyproject.toml` and `uv.lock` for Python projects
37+
- `scm`: Reads version directly from git tags without modifying files
38+
3. **Project Version**: The current version of your project will be detected automatically
39+
4. **Tag Format**: The format used for version tags in your repository
40+
5. **Version Type**: Choose between:
41+
- `semver` or `semver2`: Semantic Versioning (MAJOR.MINOR.PATCH)
42+
- `pep440`: Python Package Versioning
43+
6. **Changelog Generation**: Configure whether to automatically generate changelog during version bumps
44+
7. **Alpha Versioning**: Option to keep major version at 0 for alpha/beta software
45+
8. **Pre-commit Hooks**: Set up Git pre-commit hooks for automated commit message validation
46+
47+
## Example
48+
49+
```sh
50+
# Start the initialization process
51+
cz init
52+
53+
# Follow the interactive prompts to configure your project
54+
```
55+
56+
## Next Steps
1757

18-
The `init` will help you with
58+
After initialization, you can:
1959

20-
1. Choose a convention rules (`name`)
21-
2. Choosing a version provider (`commitizen` or for example `Cargo.toml`)
22-
3. Detecting your project's version
23-
4. Detecting the tag format used
24-
5. Choosing a version type (`semver` or `pep440`)
25-
6. Whether to create the changelog automatically or not during bump
26-
7. Whether you want to keep the major as zero while building alpha software.
27-
8. Whether to setup pre-commit hooks.
60+
1. Start using `cz commit` to create conventional commits
61+
2. Use `cz bump` to manage versioning
62+
3. Configure additional settings in your project's configuration file

0 commit comments

Comments
 (0)