Skip to content

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

License

Notifications You must be signed in to change notification settings

BarisDilekci/commitz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Commitz

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

Go Version License

✨ 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

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.)

🎯 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

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

πŸŽ“ 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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages