You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> 📘 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
-
-`--exclude` or `-x`: Files to exclude from AI analysis
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
-
- When enabled, all commit messages will include a detailed body section
384
-
- Useful for providing more context in commit messages
385
-
-`--auto-select` or `-s`: Automatically select the commit message when only one AI model is configured (default: **false**)
386
-
- When enabled and only one AI provider is configured, the generated message is automatically selected
387
-
- Also skips the confirmation prompt for a seamless experience
388
-
- Has no effect when multiple AI providers are configured
389
-
-`--disable-lowercase`: Disable automatic lowercase conversion of commit messages (default: **false**)
390
-
- Preserves the original casing of commit types and descriptions
391
-
- Useful when working with custom commit conventions that require specific casing
392
-
-`--hook-mode`: Run as a Git hook, typically used with [`prepare-commit-msg` hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks#_committing_workflow_hooks) hook (default: **false**)
393
-
- This mode is automatically enabled when running through the Git hook system
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 JSON Lines format (one JSON object per line)
404
-
- Outputs `{"subject":"...","body":"..."}` for each generated message
405
-
- Designed for integration with tools like [LazyGit](#lazygit)
406
-
- Skips TUI and exits after outputting messages
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:
|`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:
0 commit comments