A simple, lightweight commitizen-like tool for creating standardized Git commit messages following the Conventional Commits format.
Commitish streamlines your Git workflow by helping you craft well-formatted commit messages without needing to remember the conventional commits syntax. It provides an interactive interface to select commit types, add scopes, and include detailed descriptions when needed.
- Interactive commit type selection using fuzzy search
- Support for all standard conventional commit types
- Optional scoping of commits
- Optional multi-line commit body
- Breaking changes notation
- Verification of Git repository and staged changes
- fzf - Command-line fuzzy finder
- Git
- Download the scripts:
curl -o /usr/local/bin/commitish https://raw.githubusercontent.com/victor141516/commitish/refs/heads/master/commitish
curl -o /usr/local/bin/_commitish_ai https://raw.githubusercontent.com/victor141516/commitish/refs/heads/master/_commitish_ai- Make the scripts executable:
chmod +x /usr/local/bin/commitish /usr/local/bin/_commitish_ai- For AI features, set your OpenAI API key:
echo 'export OPENAI_API_KEY=your_api_key' >> ~/.zshrcFor ZSH shell autocomplete support:
- Download the completion file:
curl -o /usr/local/share/zsh/site-functions/_commitish https://raw.githubusercontent.com/victor141516/commitish/refs/heads/master/_commitish- Make it executable:
chmod +x /usr/local/share/zsh/site-functions/_commitish- Restart your shell or run:
autoload -U _commitishBasic usage:
commitishThis will prompt you to:
- Select a commit type (feat, fix, docs, etc.)
- Optionally provide a scope
- Enter a commit message
- Optionally specify breaking changes
Start with a specific commit type:
commitish fix # Pre-selects the "fix" typeInclude a multi-line commit body:
commitish -bCombine type and body flag:
commitish feat -b-h, --help Show the help message and exit
-b, --body Include a commit body (multi-line description)
--no-verify Skip git hooks (passes --no-verify to git commit)
--ai Use AI to suggest commit details (requires OPENAI_API_KEY)
The --ai option uses OpenAI to suggest commit type, scope, message, and body based on your staged changes.
It requires the _commitish_ai helper command to be installed and available in your PATH (see Installation).
Requirements:
_commitish_aiinstalled and inPATHOPENAI_API_KEYenvironment variable set with your OpenAI API keyjqinstalled (for JSON parsing)
Setup:
export OPENAI_API_KEY=your_api_key_hereHow it works:
- Analyzes your staged changes (git diff --cached)
- Reviews your last 5 commits to understand your commit style
- If you typically use scopes (e.g.,
feat(api):), it will suggest scopes - Makes parallel API calls to get suggestions for type, scope, message, and body
- Prepopulates the interactive prompts with suggestions (you can accept or modify)
Example:
commitish --ai # Get AI suggestions and interactively review/modify them| Type | Description |
|---|---|
| feat | A new feature |
| fix | A bug fix |
| docs | Documentation only changes |
| style | Changes that do not affect the meaning of the code |
| refactor | A code change that neither fixes a bug nor adds a feature |
| perf | A code change that improves performance |
| test | Adding missing tests or correcting existing tests |
| build | Changes that affect the build system or external dependencies |
| ci | Changes to CI configuration files and scripts |
| chore | Other changes that don't modify src or test files |
| revert | Reverts a previous commit |
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
commitish😉 - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Conventional Commits for the commit message specification
- commitizen for inspiration
