aicommit2 2.4.31 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +146 -57
- package/dist/cli.mjs +184 -173
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,25 +78,24 @@ _aicommit2_ automatically generates commit messages using AI. It supports [Git](
|
|
|
78
78
|
- **[Git Hook Integration](#git-hooks)**: Can be used as a prepare-commit-msg hook
|
|
79
79
|
- **[Custom Prompt](#custom-prompt-template)**: Supports user-defined system prompt templates
|
|
80
80
|
|
|
81
|
-
## Supported
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
- [
|
|
86
|
-
- [
|
|
87
|
-
- [
|
|
88
|
-
|
|
89
|
-
- [
|
|
90
|
-
- [
|
|
91
|
-
- [
|
|
92
|
-
|
|
93
|
-
- [
|
|
94
|
-
- [
|
|
95
|
-
- [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
- [Ollama](docs/providers/ollama.md)
|
|
81
|
+
## Supported Providers
|
|
82
|
+
|
|
83
|
+
| Provider | Default Model | Documentation |
|
|
84
|
+
|----------|---------------|---------------|
|
|
85
|
+
| OpenAI | `gpt-4o-mini` | [Guide](docs/providers/openai.md) |
|
|
86
|
+
| Anthropic | `claude-sonnet-4-20250514` | [Guide](docs/providers/anthropic.md) |
|
|
87
|
+
| Gemini | `gemini-3-flash-preview` | [Guide](docs/providers/gemini.md) |
|
|
88
|
+
| Mistral | `mistral-small-latest` | [Guide](docs/providers/mistral.md) |
|
|
89
|
+
| Codestral | `codestral-latest` | [Guide](docs/providers/mistral.md) |
|
|
90
|
+
| Cohere | `command-a-03-2025` | [Guide](docs/providers/cohere.md) |
|
|
91
|
+
| Groq | `llama-3.3-70b-versatile` | [Guide](docs/providers/groq.md) |
|
|
92
|
+
| Perplexity | `sonar` | [Guide](docs/providers/perplexity.md) |
|
|
93
|
+
| DeepSeek | `deepseek-chat` | [Guide](docs/providers/deepseek.md) |
|
|
94
|
+
| GitHub Models | `gpt-4o-mini` | [Guide](docs/providers/github-models.md) |
|
|
95
|
+
| Bedrock | `anthropic.claude-haiku-4-5-20251001-v1:0` | [Guide](docs/providers/bedrock.md) |
|
|
96
|
+
| Ollama | *(user configured)* | [Guide](docs/providers/ollama.md) |
|
|
97
|
+
|
|
98
|
+
> 📘 For OpenAI-compatible APIs, see [Compatibility Guide](docs/providers/compatible.md)
|
|
100
99
|
|
|
101
100
|
## Setup
|
|
102
101
|
|
|
@@ -362,48 +361,47 @@ aicommit2 --all # or -a
|
|
|
362
361
|
|
|
363
362
|
#### CLI Options
|
|
364
363
|
|
|
364
|
+
Run `aicommit2 --help` to see all available options grouped by category.
|
|
365
|
+
|
|
366
|
+
##### Message Options
|
|
367
|
+
|
|
365
368
|
- `--locale` or `-l`: Locale to use for the generated commit messages (default: **en**)
|
|
366
|
-
- `--all` or `-a`: Automatically stage changes in tracked files for the commit (default: **false**)
|
|
367
|
-
- `--type` or `-t`: Git commit message format (default: **conventional**). It supports [`conventional`](https://conventionalcommits.org/) and [`gitmoji`](https://gitmoji.dev/)
|
|
368
|
-
- `--confirm` or `-y`: Skip confirmation when committing after message generation (default: **false**)
|
|
369
|
-
- `--clipboard` or `-c`: Copy the selected message to the clipboard (default: **false**).
|
|
370
|
-
- If you give this option, **_aicommit2_ will not commit**.
|
|
371
|
-
- `--dry-run` or `-d`: Generate commit message without committing (default: **false**).
|
|
372
|
-
- Outputs the generated message without executing a commit.
|
|
373
|
-
- Useful for reviewing messages before manual commit (e.g., with GitHub Desktop).
|
|
374
|
-
- Can be combined with `--clipboard` to copy the message for use in other tools.
|
|
375
|
-
- `--edit` or `-e`: Open the AI-generated commit message in your default editor for modification (default: **false**)
|
|
376
|
-
- Opens the message in the editor specified by `$VISUAL`, `$EDITOR`, or platform default
|
|
377
|
-
- Works with both Git and Jujutsu repositories
|
|
378
|
-
- Allows fine-tuning of AI-generated messages before committing
|
|
379
369
|
- `--generate` or `-g`: Number of messages to generate (default: **1**)
|
|
380
370
|
- **Warning**: This uses more tokens, meaning it costs more.
|
|
381
|
-
- `--
|
|
371
|
+
- `--type` or `-t`: Git commit message format (default: **conventional**). It supports [`conventional`](https://conventionalcommits.org/) and [`gitmoji`](https://gitmoji.dev/)
|
|
372
|
+
- `--prompt` or `-p`: Custom prompt to fine-tune the AI generation
|
|
382
373
|
- `--include-body` or `-i`: Force include commit body in all generated messages (default: **false**)
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
- `--
|
|
390
|
-
|
|
391
|
-
-
|
|
392
|
-
- `--
|
|
393
|
-
-
|
|
394
|
-
- See [Git Hooks](#git-hooks) section for more details
|
|
395
|
-
- `--pre-commit`: Run in [pre-commit](https://pre-commit.com/) framework mode (default: **false**)
|
|
396
|
-
- This option is specifically for use with the pre-commit framework
|
|
397
|
-
- See [Integration with pre-commit framework](#integration-with-pre-commit-framework) section for setup instructions
|
|
398
|
-
- `--verbose` or `-v`: Enable verbose logging for enhanced debugging output (default: **false**)
|
|
399
|
-
- When enabled, shows detailed log messages including readline errors and other diagnostic information
|
|
400
|
-
- Useful for troubleshooting issues or understanding the tool's internal operations
|
|
401
|
-
- Can also be set via config: `aicommit2 config set logLevel=verbose`
|
|
374
|
+
|
|
375
|
+
##### Behavior
|
|
376
|
+
|
|
377
|
+
- `--all` or `-a`: Automatically stage changes in tracked files for the commit (default: **false**)
|
|
378
|
+
- `--confirm` or `-y`: Skip confirmation when committing after message generation (default: **false**)
|
|
379
|
+
- `--auto-select` or `-s`: Automatically select when only one message is generated (default: **false**)
|
|
380
|
+
- `--edit` or `-e`: Open the AI-generated commit message in your default editor (default: **false**)
|
|
381
|
+
- `--clipboard` or `-c`: Copy the selected message to the clipboard (default: **false**)
|
|
382
|
+
- If you give this option, **_aicommit2_ will not commit**.
|
|
383
|
+
- `--dry-run` or `-d`: Generate commit message without committing (default: **false**)
|
|
384
|
+
- Useful for reviewing messages before manual commit (e.g., with GitHub Desktop)
|
|
402
385
|
- `--output` or `-o`: Output format for non-interactive mode (default: **none**)
|
|
403
|
-
- Use `--output json` for
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
386
|
+
- Use `--output json` for [LazyGit](#lazygit) integration
|
|
387
|
+
|
|
388
|
+
##### VCS Selection
|
|
389
|
+
|
|
390
|
+
- `--git`: Force use Git (overrides auto-detection)
|
|
391
|
+
- `--yadm`: Force use YADM (overrides auto-detection)
|
|
392
|
+
- `--jj`: Force use Jujutsu (overrides auto-detection)
|
|
393
|
+
- `--jj-auto-new`: Run `jj new` after `jj describe` (default: **false**)
|
|
394
|
+
|
|
395
|
+
##### Hook Integration
|
|
396
|
+
|
|
397
|
+
- `--hook-mode`: Run as a Git hook with [`prepare-commit-msg`](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks#_committing_workflow_hooks) (default: **false**)
|
|
398
|
+
- `--pre-commit`: Run in [pre-commit](https://pre-commit.com/) framework mode (default: **false**)
|
|
399
|
+
|
|
400
|
+
##### Formatting & Debug
|
|
401
|
+
|
|
402
|
+
- `--exclude` or `-x`: Files to exclude from AI analysis
|
|
403
|
+
- `--disable-lowercase`: Preserve original casing of commit messages (default: **false**)
|
|
404
|
+
- `--verbose` or `-v`: Enable verbose logging for debugging (default: **false**)
|
|
407
405
|
|
|
408
406
|
Examples:
|
|
409
407
|
|
|
@@ -424,6 +422,38 @@ aicommit2 -d -c
|
|
|
424
422
|
aicommit2 --verbose # or -v
|
|
425
423
|
```
|
|
426
424
|
|
|
425
|
+
#### Commands
|
|
426
|
+
|
|
427
|
+
In addition to the main commit message generation, aicommit2 provides several utility commands:
|
|
428
|
+
|
|
429
|
+
| Command | Description |
|
|
430
|
+
|---------|-------------|
|
|
431
|
+
| `aicommit2 config` | Manage configuration (get, set, list, del) |
|
|
432
|
+
| `aicommit2 doctor` | Check health status of AI providers |
|
|
433
|
+
| `aicommit2 stats` | View usage statistics and performance metrics |
|
|
434
|
+
| `aicommit2 hook` | Install/uninstall Git prepare-commit-msg hook |
|
|
435
|
+
| `aicommit2 log` | Manage log files |
|
|
436
|
+
| `aicommit2 github-login` | Login to GitHub for GitHub Models access |
|
|
437
|
+
|
|
438
|
+
```bash
|
|
439
|
+
# Configuration management
|
|
440
|
+
aicommit2 config set OPENAI.key=<your-key>
|
|
441
|
+
aicommit2 config get OPENAI
|
|
442
|
+
aicommit2 config list
|
|
443
|
+
|
|
444
|
+
# Health check
|
|
445
|
+
aicommit2 doctor
|
|
446
|
+
|
|
447
|
+
# Statistics
|
|
448
|
+
aicommit2 stats
|
|
449
|
+
aicommit2 stats -d 7 # Last 7 days
|
|
450
|
+
aicommit2 stats clear # Clear all stats
|
|
451
|
+
|
|
452
|
+
# Git hook
|
|
453
|
+
aicommit2 hook install
|
|
454
|
+
aicommit2 hook uninstall
|
|
455
|
+
```
|
|
456
|
+
|
|
427
457
|
## Integrations
|
|
428
458
|
|
|
429
459
|
### LazyGit
|
|
@@ -600,6 +630,65 @@ aicommit2 hook uninstall
|
|
|
600
630
|
|
|
601
631
|
Or manually delete the `.git/hooks/prepare-commit-msg` file.
|
|
602
632
|
|
|
633
|
+
### Health Check
|
|
634
|
+
|
|
635
|
+
Use the `doctor` command to check the status of your configured AI providers:
|
|
636
|
+
|
|
637
|
+
```bash
|
|
638
|
+
aicommit2 doctor
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
Example output:
|
|
642
|
+
|
|
643
|
+
```
|
|
644
|
+
🩺 AICommit2 Health Check
|
|
645
|
+
|
|
646
|
+
Providers:
|
|
647
|
+
✅ OPENAI API key configured
|
|
648
|
+
✅ OLLAMA Running (Host: http://localhost:11434)
|
|
649
|
+
⏭️ ANTHROPIC Not configured
|
|
650
|
+
⚠️ GEMINI API key configured
|
|
651
|
+
|
|
652
|
+
Summary: 2 healthy, 0 error, 1 warning, 1 skipped
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
Status icons:
|
|
656
|
+
- ✅ **Healthy**: Provider is properly configured
|
|
657
|
+
- ⚠️ **Warning**: Provider has issues (e.g., Ollama not running)
|
|
658
|
+
- ❌ **Error**: Provider configuration has errors
|
|
659
|
+
- ⏭️ **Skipped**: Provider is not configured
|
|
660
|
+
|
|
661
|
+
### Statistics
|
|
662
|
+
|
|
663
|
+
Use the `stats` command to view AI request statistics and performance metrics:
|
|
664
|
+
|
|
665
|
+
```bash
|
|
666
|
+
aicommit2 stats
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
Example output:
|
|
670
|
+
|
|
671
|
+
```
|
|
672
|
+
📊 AICommit2 Statistics
|
|
673
|
+
Period: 2/10/2026 - 3/10/2026
|
|
674
|
+
|
|
675
|
+
Overview:
|
|
676
|
+
Total requests: 126
|
|
677
|
+
Success rate: 97.6%
|
|
678
|
+
Avg response time: 2.1s
|
|
679
|
+
|
|
680
|
+
Provider Usage:
|
|
681
|
+
OPENAI ████████████████████ 78 (62%) 2.2s 100%
|
|
682
|
+
ANTHROPIC ██████████░░░░░░░░░░ 30 (24%) 2.5s 93%
|
|
683
|
+
GEMINI ████░░░░░░░░░░░░░░░░ 18 (14%) 1.6s 100%
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
Options:
|
|
687
|
+
- `aicommit2 stats -d 7` - Show statistics for the last 7 days
|
|
688
|
+
- `aicommit2 stats clear` - Clear all statistics
|
|
689
|
+
|
|
690
|
+
Statistics are stored locally at `~/.config/aicommit2/stats.json`. Use `aicommit2 stats clear` to reset.
|
|
691
|
+
|
|
603
692
|
## Configuration
|
|
604
693
|
|
|
605
694
|
aicommit2 supports configuration via command-line arguments, environment variables, and a configuration file. Settings are resolved in the following order of precedence:
|
|
@@ -744,7 +833,7 @@ aicommit2 config set \
|
|
|
744
833
|
maxTokens=1024 \
|
|
745
834
|
temperature=0.7 \
|
|
746
835
|
OPENAI.key="sk-..." OPENAI.model="gpt-4o-mini" OPENAI.temperature=0.5 \
|
|
747
|
-
ANTHROPIC.key="sk-..." ANTHROPIC.model="claude-
|
|
836
|
+
ANTHROPIC.key="sk-..." ANTHROPIC.model="claude-sonnet-4-20250514" ANTHROPIC.maxTokens=2000 \
|
|
748
837
|
MISTRAL.key="your-key" MISTRAL.model="mistral-small-latest" \
|
|
749
838
|
OLLAMA.model="llama3.2" OLLAMA.numCtx=4096 OLLAMA.watchMode=true
|
|
750
839
|
```
|