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.
It is inspired by commitizen
- 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.
Pick whichever line matches your setup — none of them require downloading a binary by hand.
brew install rockingrohit9639/tap/czUpgrade later with brew upgrade cz.
scoop bucket add rockingrohit9639 https://github.com/rockingrohit9639/scoop-bucket
scoop install czUpgrade later with scoop update cz.
For machines without Homebrew. Installs to /usr/local/bin, falling back to
~/.local/bin when that is not writable.
curl -sSfL https://raw.githubusercontent.com/rockingrohit9639/cz/main/install.sh | shPin a version or change the location with environment variables:
curl -sSfL https://raw.githubusercontent.com/rockingrohit9639/cz/main/install.sh \
| CZ_VERSION=v2.0.0 CZ_INSTALL_DIR="$HOME/bin" shFor machines without Scoop. Installs to %LOCALAPPDATA%\cz\bin and adds it to
your user PATH.
irm https://raw.githubusercontent.com/rockingrohit9639/cz/main/install.ps1 | iexPin a version or change the location by setting $env:CZ_VERSION /
$env:CZ_INSTALL_DIR before running it.
go install github.com/rockingrohit9639/cz@latestPrebuilt archives for Linux, macOS, and Windows (amd64 and arm64) are attached to
every release, along with a
checksums.txt to verify them.
git clone https://github.com/rockingrohit9639/cz.git
cd cz
go buildcz versionOnce 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:
czThe 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 undoThe add command stages all modified, deleted, and new files, preparing them for commit. It's equivalent to running git add .
Usage:
cz addThis command retrives the last commit message done with cz.
Usage:
cz get-prev-commitThis command adds a new commit format in config. You can later use this to format your new commit messages.
Usage:
cz add-formatPrints the version, commit, and build date of your cz binary. Useful when reporting issues.
cz versionReleases are fully automated by GoReleaser. Cutting one is:
git tag v2.1.0
git push origin v2.1.0The Release workflow then builds all six binaries (linux/darwin/windows x amd64/arm64),
publishes the GitHub release with checksums and a generated changelog, and pushes the
updated Homebrew cask and Scoop manifest to the tap repositories.
- Create two public repositories under the same account:
homebrew-tap— receivesCasks/cz.rbscoop-bucket— receivesbucket/cz.json
- Create a GitHub personal access token that can write to both:
- Classic token with the
reposcope, or - Fine-grained token scoped to those two repos with Contents: read and write
- Classic token with the
- Add it to this repository as the secret
GORELEASER_TOKEN(Settings → Secrets and variables → Actions → New repository secret).
The built-in GITHUB_TOKEN publishes the release itself but cannot write to other
repositories, which is why the extra token is required.
goreleaser check
goreleaser release --snapshot --clean --skip=publishArtifacts land in dist/. Every pull request also runs this dry run in CI, so a broken
.goreleaser.yaml is caught before you tag.
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
cztool 😄) - 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
.czrcfile - Create command to set default commit format
