Generate commits with AI
English | Português
Commit Generator is a tool that leverages AI to automatically generate commit messages based on changes in your code.
Writing meaningful commit messages can be tedious, and inconsistent messages make version history difficult to navigate.
Commit Generator eliminates this hassle by analyzing your code changes and generating clear, structured, and relevant commit messages automatically.
Currently, the primary way to interact with Commit Generator is through the CLI.
Before installing, ensure you have the following dependencies:
Follow these steps to install and set up Commit Generator:
- Install the package
npm install --global @commit-generator/cli
- Initialize AI configuration
commitgen config init
Once installed, follow these steps to generate commit messages using AI.
- Stage your modified files
git add .
- Generate a commit message
commitgen
🎉 Done! Commit Generator will analyze your staged changes and suggest a meaningful commit message.
For more details, check out the CLI documentation.
✅ AI-powered commit message generation – Uses AI to analyze code changes and generate meaningful commit messages.
✅ Seamless Git integration – Analyzes Git diffs and staged files for precise commit suggestions.
✅ Standardized commit types – Supports feat
, fix
, chore
, docs
, refactor
, test
, style
, build
, ci
, perf
, and revert
.
✅ Context-aware commits – Add extra context (e.g., issue numbers, scope, or additional details) for more clarity.
✅ Automated commits – Use --force
to commit changes instantly without manual confirmation.
✅ Commit editing & history management – Modify, amend, and validate commit messages easily with commands like commitgen edit
, commitgen amend
, and commitgen validate
.
✅ Commit message validation – Ensures messages follow best practices and provides recommendations.
✅ Configurable AI provider – Customize AI settings via commitgen config
, with options to set, unset, and list configurations.
commit-generator/
│── docs/ # Documentation files
│── packages/
│ ├── git/ # Git integration
│ ├── ai-models/ # Handles AI model interactions
│ ├── prompt-parser/ # Parses text templates into structured prompts
│ ├── commit-history/ # Tracks previously generated commit messages
│ ├── config/ # Configuration manager
│ ├── eslint-config/ # Pre-configured ESLint settings
│ ├── typescript-config/ # TypeScript configurations
│── projects
│ ├── core/ # The core logic for commit generation
│ ├── cli/ # CLI interface for commit generator
│── .gitignore
│── package.json
│── README.md
Each package is documented separately. See:
Commit Generator is open-source and released under the MIT License. Feel free to use, modify, and contribute!