AI-powered Git commit message generator with multi-language support
Project description
AI-Commiter
grit = Git Review Intelligence Tool
AI-powered Git commit message generator with multi-language support. Analyzes file changes and generates clear, structured commit messages using OpenAI API.
인공지능을 활용한 다국어 지원 Git 커밋 메시지 생성기입니다. 파일 변경 내역을 분석하고 OpenAI API를 통해 명확하고 구조화된 커밋 메시지를 생성합니다.
✨ Key Features
- 🌍 Multi-language Support: Generate commit messages in Korean, English, Japanese, Chinese (Simplified/Traditional)
- 🤖 Intelligent Analysis: Analyzes Git diff to create specific, structured commit messages
- 📝 Conventional Commits: Uses standardized format with structured body using bullet points
- 📁 File Categorization: Categorizes multiple file changes and provides summary information
- ⚙️ Custom Prompts: Support for user-defined prompt templates
- ⚡ Simple CLI: Use
gritcommand for quick and convenient access - 🧠 Multiple AI Models: Choose from various OpenAI GPT models with automatic complexity-based selection
- 📋 Structured Output: Body messages formatted with bullet points for better readability
📦 Installation
Option 1: Homebrew (macOS Recommended)
# Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python and pipx
brew install python pipx
pipx ensurepath && source ~/.zshrc
# Install AI-Commiter
pipx install ai-commiter
Option 2: pipx (Cross-platform)
# Install pipx
pip3 install pipx # macOS/Linux
pipx ensurepath
# Apply environment variables
source ~/.zshrc # macOS (zsh)
source ~/.bashrc # Linux (bash)
# Install AI-Commiter
pipx install ai-commiter
Option 3: pip3 (Direct installation)
# macOS/Linux
pip3 install ai-commiter
# Windows
pip install ai-commiter
🔑 API Key Setup
AI-Commiter supports two environment variables for OpenAI API key:
AI_COMMITER_API_KEY- Dedicated for AI-Commiter (recommended)OPENAI_API_KEY- Standard OpenAI environment variable
Permanent Setup (Recommended)
# macOS (zsh)
echo 'export AI_COMMITER_API_KEY=your-api-key-here' >> ~/.zshrc
source ~/.zshrc
# Linux (bash)
echo 'export AI_COMMITER_API_KEY=your-api-key-here' >> ~/.bashrc
source ~/.bashrc
# Windows
setx AI_COMMITER_API_KEY "your-api-key-here"
# Restart terminal after running the command
Temporary Setup
# macOS/Linux
export AI_COMMITER_API_KEY=your-api-key-here
# Windows
set AI_COMMITER_API_KEY=your-api-key-here
🔄 Upgrade
# pipx
pipx upgrade ai-commiter
# pip3 (macOS/Linux)
pip3 install --upgrade ai-commiter
# pip (Windows)
pip install --upgrade ai-commiter
# Check version
grit --version # 또는 grit -v
🚀 Quick Start
# Generate commit message (preview)
grit commit
# Generate and commit automatically
grit commit --commit
# Use Korean language
grit commit --lang ko --commit
# Use GPT-4 for complex changes
grit commit --model gpt-4 --commit
# Auto-split complex changes into multiple commits
grit commit --commit --split
📝 Usage Examples
# Basic usage
grit commit # Preview commit message
grit commit --commit # Generate and commit
grit commit --repo /path/to/repo # Specify repository path
# Language options
grit commit --lang ko # Korean
grit commit --lang en # English (default)
grit commit --lang ja # Japanese
grit commit --lang zh-CN # Chinese Simplified
grit commit --lang zh-TW # Chinese Traditional
# Model selection
grit commit --model gpt-4 # For complex changes
grit commit --model gpt-3.5-turbo # For simple changes (default)
# Advanced options
grit commit --all # Include unstaged changes
grit commit --prompt custom.txt # Use custom prompt template
grit commit --split # Auto-split complex changes
# Combined examples
grit commit --lang ko --model gpt-4 --commit
grit commit --all --lang en --split
🌍 Supported Languages
| Language | Code | Example |
|---|---|---|
| Korean | ko, ko-KR |
grit commit --lang ko |
| English | en, en-US, en-GB |
grit commit --lang en |
| Japanese | ja, ja-JP |
grit commit --lang ja |
| Chinese (Simplified) | zh, zh-CN |
grit commit --lang zh-CN |
| Chinese (Traditional) | zh-TW |
grit commit --lang zh-TW |
Note: Commit titles are always in English (imperative mood) following Conventional Commits standard. Only the detailed descriptions are localized.
📋 Output Example
🧠 Complexity analysis: Simple changes (score: 0)
• 1 files (+0), 39 diff lines (+0)
→ Selected gpt-3.5-turbo model
🤖 AI is generating commit message...
📝 Generated commit message:
--------------------------------------------------
docs: Update commit prompt template
- 커밋 프롬프트 템플릿 업데이트
- 커밋 메시지 템플릿 내용 수정 및 명확하게 작성 요청
--------------------------------------------------
⚙️ Custom Prompt Templates
Create custom prompt template files to adjust AI-generated commit message style:
# Use custom template
grit --prompt my_template.txt
Template variables:
{diff}- Git diff content{language_instruction}- Language-specific instructions- Categorization variables for file types
Example template:
You are an expert Git commit message generator. Create a commit message following Conventional Commits format.
## Requirements:
- Type: feat, fix, docs, style, refactor, test, chore, perf, ci, build
- Title: English imperative mood (max 50 chars)
- Body: Bullet points with specific changes
## Code Changes:
{diff}
## Language:
{language_instruction}
📋 Requirements
- Python 3.7+
- Git
- OpenAI API Key
📄 License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_commiter-1.0.1.tar.gz.
File metadata
- Download URL: ai_commiter-1.0.1.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf6ee045bcb20a9c851cded302ccfd19ca338bb9a958c08b0ef14e45cf901491
|
|
| MD5 |
beaa62f00c43c47dca78a49ae8428073
|
|
| BLAKE2b-256 |
5ebfab9fd9da2d1dc17a568b8fdfb311a292cbf3f6ca87ebd753aedf0308e2e0
|
File details
Details for the file ai_commiter-1.0.1-py3-none-any.whl.
File metadata
- Download URL: ai_commiter-1.0.1-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
842fe22814cd08490fd955b59016e53e1bc53cc62b4d30cae79b82a1f215ed8b
|
|
| MD5 |
02f3d9813608c8a3f64ec8e90e3d64e3
|
|
| BLAKE2b-256 |
384e4eb68bbe0a38c3e60672395a345c98a24a3bea7f3eebef7f900afdaf2196
|