aicommit2 2.3.6 → 2.4.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.
Files changed (3) hide show
  1. package/README.md +92 -14
  2. package/dist/cli.mjs +152 -80
  3. package/package.json +7 -2
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <h1 align="center">AICommit2</h1>
5
5
  </div>
6
6
  <p>
7
- A Reactive CLI that generates git commit messages with Ollama, ChatGPT, Gemini, Claude, Mistral and other AI
7
+ A Reactive CLI that generates commit messages for Git and Jujutsu with Ollama, ChatGPT, Gemini, Claude, Mistral and other AI
8
8
  </p>
9
9
  </div>
10
10
 
@@ -27,22 +27,27 @@ ______________________________________________________________________
27
27
  npm install -g aicommit2
28
28
  # Set up at least one AI provider
29
29
  aicommit2 config set OPENAI.key=<your-key>
30
- # Use in your git repository
30
+
31
+ # Use in your Git repository
31
32
  git add .
32
33
  aicommit2
34
+
35
+ # Also works with Jujutsu repositories (auto-detected)
36
+ aicommit2
33
37
  ```
34
38
 
35
39
  ## 📖 Introduction
36
40
 
37
- _aicommit2_ is a reactive CLI tool that automatically generates Git commit messages using various AI models. It supports simultaneous requests to multiple AI providers, allowing users to select the most suitable commit message. The core functionalities and architecture of this project are inspired by [AICommits](https://github.com/Nutlope/aicommits).
41
+ AICommit2 automatically generates commit messages using AI. It primarily supports Git and also works with Jujutsu (jj) repositories.
38
42
 
39
43
  ## ✨ Key Features
40
44
 
41
- - **[Multi-AI Support](#cloud-ai-services)**: Integrates with OpenAI, Anthropic Claude, Google Gemini, Mistral AI, Cohere, Groq, Ollama and more.
42
- - **[OpenAI API Compatibility](docs/providers/compatible.md)**: Support for any service that implements the OpenAI API specification.
43
- - **[Reactive CLI](#usage)**: Enables simultaneous requests to multiple AIs and selection of the best commit message.
44
- - **[Git Hook Integration](#git-hook)**: Can be used as a prepare-commit-msg hook.
45
- - **[Custom Prompt](#custom-prompt-template)**: Supports user-defined system prompt templates.
45
+ - **[VCS Support](#version-control-systems)**: Works with both Git and Jujutsu repositories
46
+ - **[Multi-AI Support](#cloud-ai-services)**: Integrates with OpenAI, Anthropic Claude, Google Gemini, Mistral AI, Cohere, Groq, Ollama and more
47
+ - **[OpenAI API Compatibility](docs/providers/compatible.md)**: Support for any service that implements the OpenAI API specification
48
+ - **[Reactive CLI](#usage)**: Enables simultaneous requests to multiple AIs and selection of the best commit message
49
+ - **[Git Hook Integration](#git-hook)**: Can be used as a prepare-commit-msg hook
50
+ - **[Custom Prompt](#custom-prompt-template)**: Supports user-defined system prompt templates
46
51
 
47
52
  ## 🤖 Supported Providers
48
53
 
@@ -81,11 +86,15 @@ aicommit2 config set ANTHROPIC.key=<your key>
81
86
  # ... (similar commands for other providers)
82
87
  ```
83
88
 
84
- 3. Run _aicommit2_ with your staged files in git repository:
89
+ 3. Run _aicommit2_ in your Git or Jujutsu repository:
85
90
 
86
91
  ```shell
92
+ # For Git repositories
87
93
  git add <files...>
88
94
  aicommit2
95
+
96
+ # Works with Jujutsu too (auto-detected, no staging needed)
97
+ aicommit2
89
98
  ```
90
99
 
91
100
  > 👉 **Tip:** Use the `aic2` alias if `aicommit2` is too long for you.
@@ -156,7 +165,7 @@ your `devcontainer.json` file:
156
165
 
157
166
  ```json
158
167
  "features": {
159
- "ghcr.io/kvokka/features/aicommit2:1": {}
168
+ "ghcr.io/kvokka/features/aicommit2:1": {}
160
169
  }
161
170
  ```
162
171
 
@@ -166,6 +175,58 @@ This CLI tool runs `git diff` to grab all your latest code changes, sends them t
166
175
 
167
176
  > If the diff becomes too large, AI will not function properly. If you encounter an error saying the message is too long or it's not a valid commit message, **try reducing the commit unit**.
168
177
 
178
+ ## Version Control Systems
179
+
180
+ ### Git (Primary)
181
+
182
+ ```bash
183
+ # Standard Git workflow
184
+ git add <files>
185
+ aicommit2
186
+ ```
187
+
188
+ - Uses `git diff --cached` for staged changes
189
+ - Supports all Git features and hooks
190
+ - Requires staging changes before commit
191
+
192
+ ### Jujutsu Support
193
+
194
+ AICommit2 also supports [Jujutsu (jj)](https://github.com/martinvonz/jj) repositories:
195
+
196
+ ```bash
197
+ # No staging needed
198
+ aicommit2
199
+
200
+ # Force use when both Git and jj present
201
+ JJ=true aicommit2
202
+ ```
203
+
204
+ **Features:**
205
+
206
+ - Automatic detection of `.jj` repositories
207
+ - Uses `jj describe` for commits
208
+ - Supports Jujutsu's fileset syntax for file exclusions
209
+
210
+ **Installation:**
211
+
212
+ ```bash
213
+ # macOS
214
+ brew install jj
215
+
216
+ # Linux/Windows
217
+ cargo install jj-cli
218
+
219
+ # Initialize repository
220
+ jj init
221
+ ```
222
+
223
+ ### Detection Priority
224
+
225
+ 1. Git repository (default)
226
+ 2. Jujutsu repository (if Git not found)
227
+ 3. Environment override: `JJ=true` forces Jujutsu
228
+ 4. Config: `aicommit2 config set jujutsu=true`
229
+
169
230
  ## Usage
170
231
 
171
232
  ### CLI mode
@@ -189,7 +250,7 @@ aicommit2 --all # or -a
189
250
 
190
251
  - `--locale` or `-l`: Locale to use for the generated commit messages (default: **en**)
191
252
  - `--all` or `-a`: Automatically stage changes in tracked files for the commit (default: **false**)
192
- - `--type` or `-t`: Git commit message format (default: **conventional**). It supports [`conventional`](https://conventionalcommits.org/) and [`gitmoji`](https://gitmoji.dev/)
253
+ - `--type` or `-t`: Git commit message format (default: **conventional**). It supports [`conventional`](https://conventionalcommits.org/), [`gitmoji`](https://gitmoji.dev/), and `jujutsu`
193
254
  - `--confirm` or `-y`: Skip confirmation when committing after message generation (default: **false**)
194
255
  - `--clipboard` or `-c`: Copy the selected message to the clipboard (default: **false**).
195
256
  - If you give this option, **_aicommit2_ will not commit**.
@@ -482,14 +543,28 @@ aicommit2 config set exclude="*.ts,*.json"
482
543
 
483
544
  Default: `conventional`
484
545
 
485
- Supported: `conventional`, `gitmoji`
546
+ Supported: `conventional`, `gitmoji`, `jujutsu`
486
547
 
487
- The type of commit message to generate. Set this to "conventional" to generate commit messages that follow the Conventional Commits specification:
548
+ The type of commit message to generate:
549
+
550
+ **Conventional Commits**: Follow the [Conventional Commits](https://conventionalcommits.org/) specification:
488
551
 
489
552
  ```sh
490
553
  aicommit2 config set type="conventional"
491
554
  ```
492
555
 
556
+ **Gitmoji**: Use [Gitmoji](https://gitmoji.dev/) emojis in commit messages:
557
+
558
+ ```sh
559
+ aicommit2 config set type="gitmoji"
560
+ ```
561
+
562
+ **Jujutsu**: Use component-focused commit messages optimized for Jujutsu workflows:
563
+
564
+ ```sh
565
+ aicommit2 config set type="jujutsu"
566
+ ```
567
+
493
568
  ##### locale
494
569
 
495
570
  Default: `en`
@@ -781,7 +856,7 @@ Use curly braces `{}` to denote these placeholders for options. The following pl
781
856
 
782
857
  - [{locale}](#locale): The language for the commit message (**string**)
783
858
  - [{maxLength}](#max-length): The maximum length for the commit message (**number**)
784
- - [{type}](#type): The type of the commit message (**conventional** or **gitmoji**)
859
+ - [{type}](#type): The type of the commit message (**conventional**, **gitmoji**, or **jujutsu**)
785
860
  - [{generate}](#generate): The number of commit messages to generate (**number**)
786
861
 
787
862
  #### Example Template
@@ -899,6 +974,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
899
974
  <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>
900
975
  <td align="center"><a href="https://github.com/delenzhang"><img src="https://avatars.githubusercontent.com/delenzhang" width="100px;" alt=""/><br /><sub><b>@delenzhang</b></sub></a><br /><a href="https://github.com/tak-bro/aicommit2/commits?author=delenzhang" title="Code">💻</a></td>
901
976
  <td align="center"><a href="https://github.com/kvokka"><img src="https://avatars.githubusercontent.com/kvokka" width="100px;" alt=""/><br /><sub><b>@kvokka</b></sub></a><br /><a href="https://github.com/tak-bro/aicommit2/commits?author=kvokka" title="Documentation">📖</a></td>
977
+ <td align="center"><a href="https://github.com/mdeweerd"><img src="https://avatars.githubusercontent.com/mdeweerd" width="100px;" alt=""/><br /><sub><b>@mdeweerd</b></sub></a><br /><a href="https://github.com/tak-bro/aicommit2/commits?author=mdeweerd" title="Code">💻</a></td>
978
+ <td align="center"><a href="https://github.com/DivitMittal"><img src="https://avatars.githubusercontent.com/DivitMittal" width="100px;" alt=""/><br /><sub><b>@DivitMittal</b></sub></a><br /><a href="https://github.com/tak-bro/aicommit2/commits?author=DivitMittal" title="Code">💻</a></td>
979
+ <td align="center"><a href="https://github.com/aaccioly"><img src="https://avatars.githubusercontent.com/aaccioly" width="100px;" alt=""/><br /><sub><b>@aaccioly</b></sub></a><br /><a href="https://github.com/tak-bro/aicommit2/commits?author=aaccioly" title="Code">💻</a></td>
902
980
  </tr>
903
981
  </table>
904
982
  <!-- markdownlint-restore -->