cz
is a command-line tool that helps developers craft well-structured commit messages. It provides an interactive experience for selecting commit types, scopes, and writing commit messages. The tool aims to make the process of creating consistent, semantic commit messages easier and more user-friendly.
- Interactive Prompts: Guides the user through a series of prompts to create well-structured commit messages.
- Commit Types: Support for standard commit types such as
feat
,fix
,docs
,style
, and more. - Scope Selection: Allows users to specify the scope of the commit, such as a module or feature.
- Commit Message Generation: Generates commit messages based on user input using a customizable template.
To install cz
, you can either clone the repository and build it yourself or use pre-built binaries.
git clone https://github.com/rockingrohit9639/cz.git
cd cz
go build
Check latest release
Once installed, you can use cz to create commit messages. Here's an example of how to use the tool:
To start creating a commit message, run:
cz
The tool will guide you through the following prompts:
Commit Type: Select the type of commit (e.g., feat, fix, docs). Scope: Optionally specify the scope of the commit. Message: Write the main commit message. Body: Add an optional body to provide more details about the commit.
After completing the prompts, you will see a preview of the generated commit message. You can then confirm and proceed with committing the changes.
The undo command reverts the last commit while keeping the changes unstaged, allowing you to modify and recommit if needed.
Usage:
cz undo
The add command stages all modified, deleted, and new files, preparing them for commit. It's equivalent to running git add .
Usage:
cz add
We welcome contributions! Feel free to open issues, submit pull requests, or suggest improvements.
- Fork the repository
- Create a new branch (git checkout -b feat/some-feature)
- Commit your changes (use our
cz
tool 😄) - Push to the branch (git push origin feat/some-feature)
- Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Add flags for type, scope, and message to override interactive prompts.
- Add retry feature for commit creation.
- Add undo command to revert the last commit.
- Warn if no changes are staged
- Add command to stage all changes
- Support for commit templates.
- Enhancements to the user interface (e.g., improved color schemes).
- Preview commit message and only commit after confirmation.
- Implement
.czrc
file