AI-powered Git commit message generator that follows conventional commit standards.
- Generates meaningful commit messages using OpenAI's GPT models
- Follows Conventional Commits format
- Supports emoji commits (Gitmoji)
- Configurable commit message language and length
- Environment variable support
- Custom OpenAI base URL support
- Node.js (v14 or higher)
- Git
- OpenAI API key
npm install ai-commit
1. Create a `.env` file in the root directory of your project.
- Add your OpenAI API key to the
.env
file:
OPENAI_API_KEY=your-api-key-here
- (Optional) Create a config.json file to customize settings:
{
"openAI": {
"apiKey": "[env]:OPENAI_API_KEY",
"baseUrl": "https://api.openai.com/v1"
},
"commit": {
"language": "en",
"maxCharacter": 100
}
}
After staging your changes with git add, simply run:
ai-commit
The tool will:
- Get the staged changes diff
- Send it to OpenAI's API
- Generate a conventional commit message
- Create the commit with the generated message
Option | Description | Default |
---|---|---|
commit.language | Commit message language | "en" |
commit.maxCharacter | Maximum commit message length | 100 |
openAI.baseUrl | Custom OpenAI API endpoint | "https://api.openai.com/v1" |
AI-Commit supports multiple commit message formats:
- Conventional Commits
- Gitmoji
- Semantic Commit Messages
- Custom formats through configuration
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (git checkout -b feature/AmazingFeature)
- Commit your changes using AI-Commit
- Push to the branch (git push origin feature/AmazingFeature)
- Open a Pull Request
- OpenAI for providing the GPT API
- Conventional Commits community
- Gitmoji project
This README provides a clear overview of the project, its features, setup instructions, and usage guidelines while maintaining a professional and engaging tone. It's structured to help users quickly understand and start using the AI-Commit tool.
AI-Commit supports multiple commit message formats:
- Conventional Commits
- Gitmoji
- Semantic Commit Messages
- Custom formats through configuration
π Documentation:
- Commit Standards Guide - Learn about different commit message standards and best practices
- Commit Prompts Guide - Explore various prompt templates for generating commit messages