aicommit2 2.1.11 → 2.2.1
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 +111 -28
- package/dist/cli.mjs +71 -63
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -25,16 +25,14 @@ _aicommit2_ is a reactive CLI tool that automatically generates Git commit messa
|
|
|
25
25
|
|
|
26
26
|
## Key Features
|
|
27
27
|
|
|
28
|
-
- **Multi-AI Support**: Integrates with OpenAI, Anthropic Claude, Google Gemini, Mistral AI, Cohere, Groq and more.
|
|
29
|
-
- **
|
|
28
|
+
- **Multi-AI Support**: Integrates with OpenAI, Anthropic Claude, Google Gemini, Mistral AI, Cohere, Groq, Ollama and more.
|
|
29
|
+
- **OpenAI API Compatibility**: Support for any service that implements the OpenAI API specification.
|
|
30
30
|
- **Reactive CLI**: Enables simultaneous requests to multiple AIs and selection of the best commit message.
|
|
31
31
|
- **Git Hook Integration**: Can be used as a prepare-commit-msg hook.
|
|
32
32
|
- **Custom Prompt**: Supports user-defined system prompt templates.
|
|
33
33
|
|
|
34
34
|
## Supported Providers
|
|
35
35
|
|
|
36
|
-
### Remote
|
|
37
|
-
|
|
38
36
|
- [OpenAI](https://openai.com/)
|
|
39
37
|
- [Anthropic Claude](https://console.anthropic.com/)
|
|
40
38
|
- [Gemini](https://gemini.google.com/)
|
|
@@ -44,10 +42,8 @@ _aicommit2_ is a reactive CLI tool that automatically generates Git commit messa
|
|
|
44
42
|
- [Perplexity](https://docs.perplexity.ai/)
|
|
45
43
|
- [DeepSeek](https://www.deepseek.com/)
|
|
46
44
|
- [Huggingface **(Unofficial)**](https://huggingface.co/chat/)
|
|
47
|
-
|
|
48
|
-
### Local
|
|
49
|
-
|
|
50
45
|
- [Ollama](https://ollama.com/)
|
|
46
|
+
- [OpenAI API Compatibility](#openai-api-compatible-services)
|
|
51
47
|
|
|
52
48
|
## Setup
|
|
53
49
|
|
|
@@ -434,21 +430,21 @@ aicommit2 config set codeReview=true
|
|
|
434
430
|
aicommit2 config set codeReviewPromptPath="/path/to/user/prompt.txt"
|
|
435
431
|
```
|
|
436
432
|
|
|
437
|
-
|
|
438
433
|
## Available General Settings by Model
|
|
439
|
-
|
|
|
440
|
-
|
|
441
|
-
|
|
|
442
|
-
|
|
|
443
|
-
|
|
|
444
|
-
|
|
|
445
|
-
|
|
|
446
|
-
|
|
|
447
|
-
|
|
|
448
|
-
|
|
|
449
|
-
|
|
|
450
|
-
|
|
|
451
|
-
|
|
|
434
|
+
| | timeout | temperature | maxTokens | topP |
|
|
435
|
+
|:---------------------------:|:-------:|:-----------:|:---------:|:------:|
|
|
436
|
+
| **OpenAI** | ✓ | ✓ | ✓ | ✓ |
|
|
437
|
+
| **Anthropic Claude** | | ✓ | ✓ | ✓ |
|
|
438
|
+
| **Gemini** | | ✓ | ✓ | ✓ |
|
|
439
|
+
| **Mistral AI** | ✓ | ✓ | ✓ | ✓ |
|
|
440
|
+
| **Codestral** | ✓ | ✓ | ✓ | ✓ |
|
|
441
|
+
| **Cohere** | | ✓ | ✓ | ✓ |
|
|
442
|
+
| **Groq** | ✓ | ✓ | ✓ | ✓ |
|
|
443
|
+
| **Perplexity** | ✓ | ✓ | ✓ | ✓ |
|
|
444
|
+
| **DeepSeek** | ✓ | ✓ | ✓ | ✓ |
|
|
445
|
+
| **Huggingface** | | | | |
|
|
446
|
+
| **Ollama** | ✓ | ✓ | | ✓ |
|
|
447
|
+
| **OpenAI API-Compatible** | ✓ | ✓ | ✓ | ✓ |
|
|
452
448
|
|
|
453
449
|
> All AI support the following options in General Settings.
|
|
454
450
|
> - systemPrompt, systemPromptPath, codeReview, codeReviewPromptPath, exclude, type, locale, generate, logging, includeBody, maxLength
|
|
@@ -804,13 +800,14 @@ Huggingface does not support the following options in General Settings.
|
|
|
804
800
|
|
|
805
801
|
### Ollama
|
|
806
802
|
|
|
807
|
-
| Setting
|
|
808
|
-
|
|
809
|
-
| `model`
|
|
810
|
-
| `host`
|
|
811
|
-
| `auth`
|
|
812
|
-
| `key`
|
|
813
|
-
| `timeout`
|
|
803
|
+
| Setting | Description | Default |
|
|
804
|
+
|------------|-------------------------------------------------------------|------------------------|
|
|
805
|
+
| `model` | Model(s) to use (comma-separated list) | - |
|
|
806
|
+
| `host` | Ollama host URL | http://localhost:11434 |
|
|
807
|
+
| `auth` | Authentication type | Bearer |
|
|
808
|
+
| `key` | Authentication key | - |
|
|
809
|
+
| `timeout` | Request timeout (milliseconds) | 100_000 (100sec) |
|
|
810
|
+
| `numCtx` | The maximum number of tokens the model can process at once | 2048 |
|
|
814
811
|
|
|
815
812
|
##### OLLAMA.model
|
|
816
813
|
|
|
@@ -852,6 +849,7 @@ aicommit2 config set OLLAMA.key=<key>
|
|
|
852
849
|
```
|
|
853
850
|
|
|
854
851
|
Few examples of authentication methods:
|
|
852
|
+
|
|
855
853
|
| **Authentication Method** | **OLLAMA.auth** | **OLLAMA.key** |
|
|
856
854
|
|---------------------------|------------------------------|---------------------------------------|
|
|
857
855
|
| Bearer | `Bearer` | `<API key>` |
|
|
@@ -870,12 +868,92 @@ Request timeout for the Ollama.
|
|
|
870
868
|
aicommit2 config set OLLAMA.timeout=<timeout>
|
|
871
869
|
```
|
|
872
870
|
|
|
871
|
+
##### OLLAMA.numCtx
|
|
872
|
+
|
|
873
|
+
The maximum number of tokens the model can process at once, determining its context length and memory usage.
|
|
874
|
+
It is recommended to set it to 4096 or higher.
|
|
875
|
+
|
|
876
|
+
```sh
|
|
877
|
+
aicommit2 config set OLLAMA.numCtx=4096
|
|
878
|
+
```
|
|
879
|
+
|
|
873
880
|
##### Unsupported Options
|
|
874
881
|
|
|
875
882
|
Ollama does not support the following options in General Settings.
|
|
876
883
|
|
|
877
884
|
- maxTokens
|
|
878
885
|
|
|
886
|
+
### OpenAI API-Compatible Services
|
|
887
|
+
|
|
888
|
+
You can configure any OpenAI API-compatible service by adding a configuration section with the `compatible=true` option. This allows you to use services that implement the OpenAI API specification.
|
|
889
|
+
|
|
890
|
+
```sh
|
|
891
|
+
# together
|
|
892
|
+
aicommit2 config set TOGETHER.compatible=true
|
|
893
|
+
aicommit2 config set TOGETHER.url=https://api.together.xyz
|
|
894
|
+
aicommit2 config set TOGETHER.path=/v1
|
|
895
|
+
aicommit2 config set TOGETHER.model=meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
|
|
896
|
+
aicommit2 config set TOGETHER.key="your-api-key"
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
| Setting | Description | Required | Default |
|
|
900
|
+
|--------------|----------------------------------------|----------------------|---------|
|
|
901
|
+
| `compatible` | Enable OpenAI API compatibility mode | ✓ (**must be true**) | false |
|
|
902
|
+
| `url` | Base URL of the API endpoint | ✓ | - |
|
|
903
|
+
| `path` | API path for chat completions | | - |
|
|
904
|
+
| `key` | API key for authentication | ✓ | - |
|
|
905
|
+
| `model` | Model identifier to use | ✓ | - |
|
|
906
|
+
|
|
907
|
+
Example configuration:
|
|
908
|
+
```ini
|
|
909
|
+
[TOGETHER]
|
|
910
|
+
compatible=true
|
|
911
|
+
key=<your-api-key>
|
|
912
|
+
url=https://api.together.xyz/v1
|
|
913
|
+
model=meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
|
|
914
|
+
|
|
915
|
+
[GEMINI_COMPATIBILITY]
|
|
916
|
+
compatible=true
|
|
917
|
+
key=<your-api-key>
|
|
918
|
+
url=https://generativelanguage.googleapis.com
|
|
919
|
+
path=/v1beta/openai/
|
|
920
|
+
model=gemini-1.5-flash
|
|
921
|
+
|
|
922
|
+
[OLLAMA_COMPATIBILITY]
|
|
923
|
+
compatible=true
|
|
924
|
+
key=ollama
|
|
925
|
+
url=http://localhost:11434/v1
|
|
926
|
+
model=llama3.2
|
|
927
|
+
```
|
|
928
|
+
|
|
929
|
+
## Watch Commit Mode
|
|
930
|
+
|
|
931
|
+

|
|
932
|
+
|
|
933
|
+
Watch Commit mode allows you to monitor Git commits in real-time and automatically perform AI code reviews using the `--watch-commit` flag.
|
|
934
|
+
|
|
935
|
+
```sh
|
|
936
|
+
aicommit2 --watch-commit
|
|
937
|
+
```
|
|
938
|
+
|
|
939
|
+
This feature only works within Git repository directories and automatically triggers whenever a commit event occurs. When a new commit is detected, it automatically:
|
|
940
|
+
1. Analyzes commit changes
|
|
941
|
+
2. Performs AI code review
|
|
942
|
+
3. Displays results in real-time
|
|
943
|
+
|
|
944
|
+
> For detailed configuration of the code review feature, please refer to the [codeReview](#codereview) section. The settings in that section are shared with this feature.
|
|
945
|
+
|
|
946
|
+
⚠️ **CAUTION**
|
|
947
|
+
|
|
948
|
+
- The Watch Commit feature is currently **experimental**
|
|
949
|
+
- This feature performs AI analysis for each commit, which **consumes a significant number of API tokens**
|
|
950
|
+
- API costs can increase substantially if there are many commits
|
|
951
|
+
- It is recommended to **carefully monitor your token usage** when using this feature
|
|
952
|
+
- To use this feature, you must enable watch mode for at least one AI model:
|
|
953
|
+
```sh
|
|
954
|
+
aicommit2 config set [MODEL].watchMode="true"
|
|
955
|
+
```
|
|
956
|
+
|
|
879
957
|
## Upgrading
|
|
880
958
|
|
|
881
959
|
Check the installed version with:
|
|
@@ -1029,7 +1107,12 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
1029
1107
|
<td align="center"><a href="https://github.com/bhodrolok"><img src="https://avatars.githubusercontent.com/bhodrolok" width="100px;" alt=""/><br /><sub><b>@bhodrolok</b></sub></a><br /><a href="https://github.com/tak-bro/aicommit2/commits?author=bhodrolok" title="Code">💻</a></td>
|
|
1030
1108
|
<td align="center"><a href="https://github.com/ryicoh"><img src="https://avatars.githubusercontent.com/ryicoh" width="100px;" alt=""/><br /><sub><b>@ryicoh</b></sub></a><br /><a href="https://github.com/tak-bro/aicommit2/commits?author=ryicoh" title="Code">💻</a></td>
|
|
1031
1109
|
<td align="center"><a href="https://github.com/noamsto"><img src="https://avatars.githubusercontent.com/noamsto" width="100px;" alt=""/><br /><sub><b>@noamsto</b></sub></a><br /><a href="https://github.com/tak-bro/aicommit2/commits?author=noamsto" title="Code">💻</a></td>
|
|
1110
|
+
<td align="center"><a href="https://github.com/tdabasinskas"><img src="https://avatars.githubusercontent.com/tdabasinskas" width="100px;" alt=""/><br /><sub><b>@tdabasinskas</b></sub></a><br /><a href="https://github.com/tak-bro/aicommit2/commits?author=tdabasinskas" title="Code">💻</a></td>
|
|
1111
|
+
<td align="center"><a href="https://github.com/gnpaone"><img src="https://avatars.githubusercontent.com/gnpaone" width="100px;" alt=""/><br /><sub><b>@gnpaone</b></sub></a><br /><a href="https://github.com/tak-bro/aicommit2/commits?author=gnpaone" title="Code">💻</a></td>
|
|
1032
1112
|
</tr>
|
|
1113
|
+
<tr>
|
|
1114
|
+
<td align="center"><a href="https://github.com/devxpain"><img src="https://avatars.githubusercontent.com/devxpain" width="100px;" alt=""/><br /><sub><b>@devxpain</b></sub></a><br /><a href="https://github.com/tak-bro/aicommit2/commits?author=devxpain" title="Code">💻</a></td>
|
|
1115
|
+
</tr>
|
|
1033
1116
|
</table>
|
|
1034
1117
|
<!-- markdownlint-restore -->
|
|
1035
1118
|
<!-- prettier-ignore-end -->
|