|
1 | | -# git-commit-ai |
| 1 | +# Git Commit AI — AI commit message generator CLI |
2 | 2 |
|
3 | | -> AI-powered commit message generator for Git. Automate your git workflow with intelligent, conventional commit messages. |
| 3 | +[](https://www.npmjs.com/package/@vavasilva/git-commit-ai) |
| 4 | +[](https://www.npmjs.com/package/@vavasilva/git-commit-ai) |
| 5 | +[](https://opensource.org/licenses/MIT) |
4 | 6 |
|
5 | | -A command-line tool that uses Large Language Models (LLMs) to analyze your staged changes and automatically generate [Karma-style](https://karma-runner.github.io/6.4/dev/git-commit-msg.html) / [Conventional Commits](https://www.conventionalcommits.org/) messages. |
| 7 | +> Generate Conventional Commit messages from staged git changes using LLMs (Ollama, llama.cpp, OpenAI, Anthropic, Groq). |
6 | 8 |
|
7 | | -**Supported AI backends:** Ollama, llama.cpp, OpenAI (GPT-4), Anthropic (Claude), Groq (LLaMA) |
| 9 | +**git-commit-ai** is a CLI that analyzes your `git diff --staged` and suggests high-quality **Conventional Commits** (`type(scope): subject`) with an interactive confirm/edit/regenerate flow. |
| 10 | + |
| 11 | +**Backends:** Ollama (local), llama.cpp (local), OpenAI (GPT models), Anthropic (Claude), Groq (Llama) |
| 12 | + |
| 13 | +## Quick Start |
| 14 | + |
| 15 | +```bash |
| 16 | +# Install |
| 17 | +npm install -g @vavasilva/git-commit-ai |
| 18 | + |
| 19 | +# 1. Make changes to your code |
| 20 | +echo "console.log('hello')" > hello.js |
| 21 | + |
| 22 | +# 2. Stage your changes |
| 23 | +git add hello.js |
| 24 | + |
| 25 | +# 3. Generate commit message and commit |
| 26 | +git-commit-ai |
| 27 | + |
| 28 | +# Output: |
| 29 | +# 📝 Generated commit message |
| 30 | +# feat: add hello.js script |
| 31 | +# [C]onfirm [E]dit [R]egenerate [A]bort? c |
| 32 | +# ✓ Committed: feat: add hello.js script |
| 33 | +``` |
| 34 | + |
| 35 | +## How it works |
| 36 | + |
| 37 | +1. You stage your changes (`git add ...`) |
| 38 | +2. git-commit-ai reads `git diff --staged` |
| 39 | +3. A selected LLM backend proposes a Conventional Commit message |
| 40 | +4. You confirm, edit, regenerate, or abort (no commit happens until you confirm) |
8 | 41 |
|
9 | 42 | ## Features |
10 | 43 |
|
11 | 44 | - **Multiple Backends** - Ollama (local), llama.cpp (local), OpenAI, Anthropic Claude, Groq |
12 | 45 | - **Auto-Detection** - Automatically selects available backend |
13 | | -- **Karma Convention** - Generates `type(scope): subject` format commits |
| 46 | +- **Conventional Commits** - Generates `type(scope): subject` format (Karma compatible) |
14 | 47 | - **Interactive Flow** - Confirm, Edit, Regenerate, or Abort before committing |
15 | 48 | - **Individual Commits** - Option to commit each file separately |
16 | 49 | - **Dry Run** - Preview messages without committing |
@@ -250,25 +283,6 @@ export ANTHROPIC_API_KEY="your-api-key" |
250 | 283 | export GROQ_API_KEY="your-api-key" |
251 | 284 | ``` |
252 | 285 |
|
253 | | -## Quick Start |
254 | | - |
255 | | -```bash |
256 | | -# 1. Make changes to your code |
257 | | -echo "console.log('hello')" > hello.js |
258 | | - |
259 | | -# 2. Stage your changes |
260 | | -git add hello.js |
261 | | - |
262 | | -# 3. Generate commit message and commit |
263 | | -git-commit-ai |
264 | | - |
265 | | -# Output: |
266 | | -# 📝 Generated commit message |
267 | | -# feat: add hello.js script |
268 | | -# [C]onfirm [E]dit [R]egenerate [A]bort? c |
269 | | -# ✓ Committed: feat: add hello.js script |
270 | | -``` |
271 | | - |
272 | 286 | ## Usage |
273 | 287 |
|
274 | 288 | ```bash |
@@ -464,7 +478,7 @@ ignore_patterns = ["dist/*", "*.generated.ts"] |
464 | 478 | | `config --set <key=value>` | Set a config value | |
465 | 479 | | `config --list-keys` | List all valid config keys | |
466 | 480 |
|
467 | | -## Commit Types (Karma Convention) |
| 481 | +## Commit Types (Conventional Commits) |
468 | 482 |
|
469 | 483 | | Type | Description | |
470 | 484 | |------|-------------| |
|
0 commit comments