aicommit2 2.4.17 → 2.4.19
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 +80 -9
- package/dist/cli.mjs +185 -122
- package/package.json +1 -1
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 commit messages for Git and Jujutsu with Ollama, ChatGPT, Gemini, Claude, Mistral, and other AI
|
|
7
|
+
A Reactive CLI that generates commit messages for Git, YADM, and Jujutsu with Ollama, ChatGPT, Gemini, Claude, Mistral, and other AI
|
|
8
8
|
</p>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
@@ -37,17 +37,18 @@ aicommit2 config set OPENAI.key=<your-key>
|
|
|
37
37
|
git add .
|
|
38
38
|
aicommit2
|
|
39
39
|
|
|
40
|
-
# Also works with Jujutsu repositories (auto-detected)
|
|
40
|
+
# Also works with YADM and Jujutsu repositories (auto-detected)
|
|
41
|
+
yadm add <file>
|
|
41
42
|
aicommit2
|
|
42
43
|
```
|
|
43
44
|
|
|
44
45
|
## Introduction
|
|
45
46
|
|
|
46
|
-
AICommit2 automatically generates commit messages using AI. It
|
|
47
|
+
AICommit2 automatically generates commit messages using AI. It supports [Git](https://git-scm.com/), [YADM](https://yadm.io/) (Yet Another Dotfiles Manager), and [Jujutsu](https://github.com/jj-vcs/jj)(jj) repositories with automatic detection. [AICommits](https://github.com/Nutlope/aicommits) inspired the core functionalities and architecture of this project.
|
|
47
48
|
|
|
48
49
|
## Key features
|
|
49
50
|
|
|
50
|
-
- **[VCS Support](#version-control-systems)**: Works with
|
|
51
|
+
- **[VCS Support](#version-control-systems)**: Works with Git, YADM, and Jujutsu repositories
|
|
51
52
|
- **[Multi-AI Support](#cloud-ai-services)**: Integrates with OpenAI, Anthropic Claude, Google Gemini, Mistral AI, Cohere, Groq, Ollama and more
|
|
52
53
|
- **[OpenAI API Compatibility](docs/providers/compatible.md)**: Support for any service that implements the OpenAI API specification
|
|
53
54
|
- **[Reactive CLI](#usage)**: Enables simultaneous requests to multiple AIs and selection of the best commit message
|
|
@@ -201,6 +202,41 @@ aicommit2
|
|
|
201
202
|
- Supports all Git features and hooks
|
|
202
203
|
- Requires staging changes before commit
|
|
203
204
|
|
|
205
|
+
### YADM Support
|
|
206
|
+
|
|
207
|
+
AICommit2 supports [YADM (Yet Another Dotfiles Manager)](https://yadm.io/) for managing dotfiles:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# Standard YADM workflow
|
|
211
|
+
yadm add <files>
|
|
212
|
+
aicommit2
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Features:**
|
|
216
|
+
|
|
217
|
+
- Automatic detection of YADM repositories (prioritized before Git)
|
|
218
|
+
- Uses `yadm` commands instead of `git` for all operations
|
|
219
|
+
- Supports all YADM features including encryption and alternate files
|
|
220
|
+
- Works with dotfiles in `$HOME` directory
|
|
221
|
+
- Hook installation: `aicommit2 hook install` (installs to `~/.config/yadm/hooks/`)
|
|
222
|
+
- **Note:** Watch mode (`--watch-commit`) is not supported for YADM repositories
|
|
223
|
+
|
|
224
|
+
**Installation:**
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# macOS
|
|
228
|
+
brew install yadm
|
|
229
|
+
|
|
230
|
+
# Linux
|
|
231
|
+
apt-get install yadm # Debian/Ubuntu
|
|
232
|
+
dnf install yadm # Fedora
|
|
233
|
+
|
|
234
|
+
# Initialize repository
|
|
235
|
+
yadm init
|
|
236
|
+
# or clone existing dotfiles
|
|
237
|
+
yadm clone <url>
|
|
238
|
+
```
|
|
239
|
+
|
|
204
240
|
### Jujutsu Support
|
|
205
241
|
|
|
206
242
|
AICommit2 also supports [Jujutsu (jj)](https://github.com/martinvonz/jj) repositories:
|
|
@@ -237,10 +273,35 @@ jj init
|
|
|
237
273
|
|
|
238
274
|
### Detection Priority
|
|
239
275
|
|
|
240
|
-
1.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
276
|
+
1. **CLI flags** (highest priority - overrides everything):
|
|
277
|
+
- `--git`: Force use Git
|
|
278
|
+
- `--yadm`: Force use YADM
|
|
279
|
+
- `--jj`: Force use Jujutsu
|
|
280
|
+
2. **Environment variables**:
|
|
281
|
+
- `FORCE_GIT=true`: Forces Git
|
|
282
|
+
- `FORCE_YADM=true`: Forces YADM
|
|
283
|
+
- `FORCE_JJ=true`: Forces Jujutsu
|
|
284
|
+
3. **Config**: `aicommit2 config set forceGit=true` (forces Git)
|
|
285
|
+
4. **Auto-detection**:
|
|
286
|
+
- Jujutsu repository (checked first - since jj v0.34.0+, repos are colocated with .git)
|
|
287
|
+
- Git repository (checked for .git directories - regular Git repos)
|
|
288
|
+
- YADM repository (checked last - for dotfiles in $HOME without .git directory)
|
|
289
|
+
|
|
290
|
+
### Force VCS Selection
|
|
291
|
+
|
|
292
|
+
Sometimes you may want to use a specific VCS even when multiple are available:
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# Use YADM in a directory that has both .git and YADM tracking
|
|
296
|
+
cd ~/my-project # Has .git directory
|
|
297
|
+
aicommit2 --yadm # Forces YADM usage instead of Git
|
|
298
|
+
|
|
299
|
+
# Use Git explicitly
|
|
300
|
+
aicommit2 --git
|
|
301
|
+
|
|
302
|
+
# Use Jujutsu explicitly
|
|
303
|
+
aicommit2 --jj
|
|
304
|
+
```
|
|
244
305
|
|
|
245
306
|
## Usage
|
|
246
307
|
|
|
@@ -269,6 +330,10 @@ aicommit2 --all # or -a
|
|
|
269
330
|
- `--confirm` or `-y`: Skip confirmation when committing after message generation (default: **false**)
|
|
270
331
|
- `--clipboard` or `-c`: Copy the selected message to the clipboard (default: **false**).
|
|
271
332
|
- If you give this option, **_aicommit2_ will not commit**.
|
|
333
|
+
- `--dry-run` or `-d`: Generate commit message without committing (default: **false**).
|
|
334
|
+
- Outputs the generated message without executing a commit.
|
|
335
|
+
- Useful for reviewing messages before manual commit (e.g., with GitHub Desktop).
|
|
336
|
+
- Can be combined with `--clipboard` to copy the message for use in other tools.
|
|
272
337
|
- `--edit` or `-e`: Open the AI-generated commit message in your default editor for modification (default: **false**)
|
|
273
338
|
- Opens the message in the editor specified by `$VISUAL`, `$EDITOR`, or platform default
|
|
274
339
|
- Works with both Git and Jujutsu repositories
|
|
@@ -306,6 +371,12 @@ aicommit2 --locale "jp" --all --type "conventional" --generate 3 --clipboard --e
|
|
|
306
371
|
# Generate and edit a commit message
|
|
307
372
|
aicommit2 --edit --type conventional # or gitmoji
|
|
308
373
|
|
|
374
|
+
# Generate message without committing (dry-run)
|
|
375
|
+
aicommit2 --dry-run # or -d
|
|
376
|
+
|
|
377
|
+
# Dry-run with clipboard (generate, select, then copy)
|
|
378
|
+
aicommit2 -d -c
|
|
379
|
+
|
|
309
380
|
# Enable verbose logging for debugging
|
|
310
381
|
aicommit2 --verbose # or -v
|
|
311
382
|
```
|
|
@@ -489,7 +560,7 @@ _aicommit2_ offers flexible configuration options for all AI services, including
|
|
|
489
560
|
key="<your-api-key>"
|
|
490
561
|
generate=5
|
|
491
562
|
includeBody=true
|
|
492
|
-
model="gemini-2.
|
|
563
|
+
model="gemini-2.5-flash,gemini-2.5-pro"
|
|
493
564
|
|
|
494
565
|
[OLLAMA]
|
|
495
566
|
temperature=0.7
|