Smart, interactive Git commit message generator that follows Conventional Commits standards.
- π― Interactive Mode - Beautiful CLI prompts to guide you through creating perfect commits
- π€ Smart Suggestions - Automatically analyzes your changes and suggests meaningful commit messages
- π¨ Emoji Support - Add expressive emojis to your commits (optional)
- π¦ Scope Detection - Automatically extracts scope from branch names and project structure
- β Validation - Ensures your commit messages follow best practices
- π Dry Run - Preview commits before creating them
- β‘ Fast & Lightweight - Written in Go, no heavy dependencies
go install github.com/barisdilekci/commitz@latestgit clone https://github.com/barisdilekci/commitz.git
cd commitz
go build
go installDownload the latest binary from releases and add it to your PATH.
# Stage your changes
git add .
# Run commitz in interactive mode
commitz -i -e
# Follow the prompts and you're done! πcommitz -iThis will guide you through:
- Selecting commit type (feat, fix, docs, etc.)
- Choosing scope (from branch or project structure)
- Writing summary (with smart suggestions)
- Adding description (optional)
- Confirming and committing
# Auto-detect everything
commitz
# Specify type
commitz -t feat -e
# Specify type and scope
commitz -t fix -s auth -e
# Dry run (preview only)
commitz -i -e -d| Type | Emoji | Description |
|---|---|---|
feat |
β¨ | A new feature |
fix |
π | A bug fix |
docs |
π | Documentation changes |
style |
π | Code style changes (formatting, etc.) |
refactor |
β»οΈ | Code refactoring |
perf |
β‘ | Performance improvements |
test |
β | Adding or updating tests |
build |
π¨ | Build system or dependency changes |
ci |
π· | CI/CD configuration changes |
chore |
π§Ή | Other changes (maintenance, etc.) |
$ commitz -i -e
? Select commit type:
βΈ β¨ feat - A new feature
π fix - A bug fix
π docs - Documentation only changes
...
? Select scope:
main (from branch)
βΈ cmd
pkg
Skip (no scope)
? Commit summary (suggestion: add interactive mode): add user authentication
Suggested commit message:
β¨ feat(auth): add user authentication
? Add detailed description? (y/N): y
Enter description:
- Implement JWT-based authentication
- Add login and registration endpoints
- Include password hashing with bcrypt
? Proceed with commit (y/N): y
β Commit successful! π$ commitz -t feat -s api -e
Suggested commit message:
β¨ feat(api): add new endpoints
Proceed with commit? [Y/n]: y
β Commit successful! π| Flag | Short | Description |
|---|---|---|
--interactive |
-i |
Enable interactive mode with prompts |
--type |
-t |
Specify commit type (feat, fix, docs, etc.) |
--scope |
-s |
Specify commit scope |
--emoji |
-e |
Add emoji to commit message |
--dry-run |
-d |
Preview commit without creating it |
--help |
-h |
Show help message |
Commitz analyzes your git diff to generate intelligent commit message suggestions:
- File analysis: Examines modified files and their paths
- Content analysis: Looks for keywords in added/modified code
- Pattern recognition: Identifies common patterns (tests, docs, fixes)
- Context awareness: Uses branch names and project structure
Automatically detects scope from:
- Branch names:
feature/authβ scope:feature - Project structure: Scans for common directories (cmd, pkg, api, etc.)
- Manual input: You can always specify your own scope
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes using commitz! (
commitz -i -e) - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This tool follows the Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Example:
feat(auth): add JWT authentication
- Implement token generation and validation
- Add middleware for protected routes
- Include refresh token mechanism
Closes #123
Make sure you've staged your changes with git add before running commitz.
git add .
commitz -iRun commitz from within a git repository.
cd your-project
commitz -iThis project is licensed under the MIT License - see the LICENSE file for details.
- Conventional Commits for the specification
- Cobra for the CLI framework
- promptui for interactive prompts
- color for colored terminal output
If you find this project useful, please consider giving it a star! β