Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🚀 Commitz

Smart, interactive Git commit message generator that follows Conventional Commits standards.

Go VersionLicense

✨ Features

  • 🎯 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

📦 Installation

Using Go Install

go install github.com/barisdilekci/commitz@latest

From Source

git clone https://github.com/barisdilekci/commitz.git
cd commitz
go build
go install

Manual Download

Download the latest binary from releases and add it to your PATH.

🎬 Quick Start

# Stage your changes
git add .# Run commitz in interactive mode
commitz -i -e
# Follow the prompts and you're done! 🎉

📖 Usage

Interactive Mode (Recommended)

commitz -i

This will guide you through:

  1. Selecting commit type (feat, fix, docs, etc.)
  2. Choosing scope (from branch or project structure)
  3. Writing summary (with smart suggestions)
  4. Adding description (optional)
  5. Confirming and committing

Quick Mode

# 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

🎨 Commit Types

TypeEmojiDescription
featA new feature
fix🐛A bug fix
docs📝Documentation changes
style💄Code style changes (formatting, etc.)
refactor♻️Code refactoring
perfPerformance improvements
testAdding or updating tests
build🔨Build system or dependency changes
ci👷CI/CD configuration changes
chore🧹Other changes (maintenance, etc.)

🎯 Examples

Interactive Mode

$ 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! 🎉

Quick Mode

$ commitz -t feat -s api -e
Suggested commit message:
✨ feat(api): add new endpoints
Proceed with commit? [Y/n]: y
✓ Commit successful! 🎉

🔧 Command-line Flags

FlagShortDescription
--interactive-iEnable interactive mode with prompts
--type-tSpecify commit type (feat, fix, docs, etc.)
--scope-sSpecify commit scope
--emoji-eAdd emoji to commit message
--dry-run-dPreview commit without creating it
--help-hShow help message

🎓 How It Works

Smart Suggestions

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

Scope Detection

Automatically detects scope from:

  1. Branch names: feature/auth → scope: feature
  2. Project structure: Scans for common directories (cmd, pkg, api, etc.)
  3. Manual input: You can always specify your own scope

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes using commitz! (commitz -i -e)
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 Conventional Commits

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

🐛 Troubleshooting

"No staged changes found"

Make sure you've staged your changes with git add before running commitz.

git add .
commitz -i

"Not a git repository"

Run commitz from within a git repository.

cd your-project
commitz -i

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

💖 Acknowledgments

🌟 Star History

If you find this project useful, please consider giving it a star! ⭐


Made with ❤️ by Barış Dilekci

About

Smart, interactive Git commit message generator that follows Conventional Commits standards.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages