https://github.com/simongino/aicommit
đ¤ AI-powered git commit message generator supporting multiple LLM providers (OpenAI, Azure OpenAI). Generate meaningful commit messages from your staged changes with a beautiful CLI interface.
https://github.com/simongino/aicommit
azure-openai cli git git-tools golang llm openai
Last synced: 3 months ago
JSON representation
đ¤ AI-powered git commit message generator supporting multiple LLM providers (OpenAI, Azure OpenAI). Generate meaningful commit messages from your staged changes with a beautiful CLI interface.
- Host: GitHub
- URL: https://github.com/simongino/aicommit
- Owner: SimonGino
- Created: 2025-02-05T15:17:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-13T03:44:03.000Z (3 months ago)
- Last Synced: 2026-01-13T06:50:11.686Z (3 months ago)
- Topics: azure-openai, cli, git, git-tools, golang, llm, openai
- Language: Go
- Homepage:
- Size: 6.69 MB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AI Commit
English | [įŽäŊ䏿](README.md)
An AI-powered Git commit message generator that automatically creates commit messages following the Conventional Commits specification.
## Features
- đ¤ **AI-Powered** - Automatically analyzes code changes and generates standardized commit messages
- đ¯ **Interactive** - Keyboard shortcuts for quick operation selection
- đ **Flexible File Selection** - Choose from staged files, select manually, or stage all
- âī¸ **Message Editing** - Edit generated messages or regenerate them
- đ§ **Config Check** - Built-in `check` command to verify configuration and API connectivity
- đ **Multi-Language** - English, Simplified Chinese, Traditional Chinese
- âī¸ **Multi-Platform** - Supports OpenAI and Azure OpenAI
- đ **Daily Reports** - Generate work reports from Git commit history
## Quick Start
### Installation
```bash
# Linux/macOS
curl -fsSL https://raw.githubusercontent.com/SimonGino/aicommit/main/scripts/install.sh | sudo bash
# Windows (Run PowerShell as Administrator)
iwr -useb https://raw.githubusercontent.com/SimonGino/aicommit/main/scripts/install.ps1 | iex
```
### Configuration
```bash
# Configure OpenAI API key
aicommit config --api-key your-openai-api-key
# Verify configuration
aicommit check
```
### Usage
```bash
# Interactive commit (recommended)
aicommit
# Use custom message
aicommit -m "feat: add new feature"
```
## Interactive Flow
Running `aicommit` displays an interactive interface:
```
Detected changes:
Staged:
â src/main.go
Modified (unstaged):
âĸ config.json
Select an action:
[a] Use current staged content to generate commit message
[s] Select files to stage
[A] Stage all changes (git add .)
[c] Cancel
Press key to select: a
Generating commit message...
â Generated commit message:
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â feat(main): add user authentication â
â â
â - Implement JWT token validation â
â - Add user login endpoint â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Select an action:
[a] Accept and commit
[e] Edit before commit
[r] Regenerate
[c] Cancel
Press key to select: a
â Changes committed
```
## Commands
| Command | Description |
|---------|-------------|
| `aicommit` | Interactive generate and commit |
| `aicommit -m "msg"` | Commit with specified message |
| `aicommit check` | Check configuration and API connectivity |
| `aicommit config` | Configure settings |
| `aicommit report` | Generate daily report |
## Configuration
Configuration file location: `~/.config/aicommit/config.json`
### OpenAI
#### Command Line Configuration
```bash
aicommit config --provider openai
aicommit config --api-key sk-your-api-key
aicommit config --model gpt-4o # optional, default: gpt-4o
aicommit config --language en # optional, default: en
```
#### Standard Config File Example
```json
{
"api_key": "sk-your-api-key-here",
"base_url": "",
"model": "gpt-4o",
"language": "en",
"provider": "openai",
"azure_api_version": ""
}
```
### Azure OpenAI
#### Command Line Configuration
```bash
aicommit config --provider azure
aicommit config --api-key your-azure-api-key
aicommit config --base-url https://your-resource.openai.azure.com
aicommit config --model your-deployment-name
aicommit config --azure-api-version 2024-02-15-preview
aicommit config --language en # optional
```
**Important Notes:**
- `--base-url` should be the base URL only (e.g., `https://your-resource.openai.azure.com`), NOT the full API path
- `--model` should be your Azure OpenAI deployment name
- `--azure-api-version` is required for Azure OpenAI
#### Standard Config File Example
```json
{
"api_key": "your-azure-api-key-here",
"base_url": "https://your-resource.openai.azure.com",
"model": "gpt-4o-mini",
"language": "en",
"provider": "azure",
"azure_api_version": "2024-02-15-preview"
}
```
### Language Settings
```bash
aicommit config --language en # English (default)
aicommit config --language zh-CN # Simplified Chinese
aicommit config --language zh-TW # Traditional Chinese
```
## Daily Reports
```bash
# This week's report
aicommit report --this-week
# Last week's report
aicommit report --last-week
# Specific date range
aicommit report --since 2024-01-01 --until 2024-01-31
```
## Commit Message Format
Follows the [Conventional Commits](https://www.conventionalcommits.org/) specification:
```
():
```
Supported types: `feat` | `fix` | `refactor` | `docs` | `style` | `test` | `chore`
## Development
```bash
git clone https://github.com/SimonGino/aicommit.git
cd aicommit
go mod download
go test ./...
go build -o aicommit ./cmd/aicommit
```
## Uninstallation
```bash
# Linux/macOS
sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/SimonGino/aicommit/main/scripts/uninstall.sh)"
# Windows (Run PowerShell as Administrator)
iwr -useb https://raw.githubusercontent.com/SimonGino/aicommit/main/scripts/uninstall.ps1 | iex
```
## License
MIT