Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ed1ecc4

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

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

AltStyle によって変換されたページ (->オリジナル) /