@sugarmo/aicommits 1.15.0 → 1.16.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 +51 -117
- package/dist/cli.mjs +114 -121
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -63,8 +63,6 @@ For example, you can stage all changes in tracked files with as you commit:
|
|
|
63
63
|
aicommits --all # or -a
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
> 👉 **Tip:** Use the `aic` alias if `aicommits` is too long for you.
|
|
67
|
-
|
|
68
66
|
#### Generate multiple recommendations
|
|
69
67
|
|
|
70
68
|
Sometimes the recommended commit message isn't the best so you want it to generate a few to pick from. You can generate multiple commit messages at once by passing in the `--generate <i>` flag, where 'i' is the number of generated messages:
|
|
@@ -82,49 +80,33 @@ If your environment does not provide an interactive TTY, skip prompts explicitly
|
|
|
82
80
|
aicommits --confirm # or -y / --yes
|
|
83
81
|
```
|
|
84
82
|
|
|
85
|
-
####
|
|
86
|
-
|
|
87
|
-
Enable `details` when you want a body only when the title is not clear enough on its own:
|
|
83
|
+
#### Guide output with Markdown
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
aicommits --details
|
|
91
|
-
```
|
|
85
|
+
Commit message style is now controlled by a Markdown file instead of individual formatting flags.
|
|
92
86
|
|
|
93
|
-
|
|
87
|
+
By default, aicommits reads `~/.aicommits/message.md`. The file is created automatically on first use.
|
|
94
88
|
|
|
95
89
|
```sh
|
|
96
|
-
aicommits
|
|
90
|
+
aicommits
|
|
97
91
|
```
|
|
98
92
|
|
|
99
|
-
|
|
93
|
+
To use a different Markdown file for one run:
|
|
100
94
|
|
|
101
95
|
```sh
|
|
102
|
-
aicommits --
|
|
96
|
+
aicommits --message-file release-message.md
|
|
103
97
|
```
|
|
104
98
|
|
|
105
|
-
|
|
99
|
+
The default file includes editable instructions for language, title format, body rules, and style. If you were previously using settings like `type`, `details`, `instructions`, or `conventional-*`, upgrade once and those values will be migrated into `message.md` automatically.
|
|
106
100
|
|
|
107
|
-
|
|
101
|
+
#### Post-process the AI response
|
|
108
102
|
|
|
109
|
-
You can
|
|
103
|
+
You can run an executable after the model responds and before the message is shown or committed.
|
|
110
104
|
|
|
111
105
|
```sh
|
|
112
|
-
aicommits --
|
|
106
|
+
aicommits --post-response-script rewrite-message.sh
|
|
113
107
|
```
|
|
114
108
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
You can combine conventional commits with custom output format and type mapping:
|
|
118
|
-
|
|
119
|
-
```sh
|
|
120
|
-
aicommits --type conventional --conventional-format "<type>(<scope>): <subject>" --conventional-types '{"feature":"Introduce a feature","bugfix":"Fix defects"}'
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
By default, conventional mode omits scope and uses `type: subject`. You can enable scope preference (for example `refactor(RecentScrollshotController): ...`) when there is a clear dominant file/class/module:
|
|
124
|
-
|
|
125
|
-
```sh
|
|
126
|
-
aicommits --conventional-scope true
|
|
127
|
-
```
|
|
109
|
+
The script receives the raw AI message on stdin and must write the final message to stdout.
|
|
128
110
|
|
|
129
111
|
### Git hook
|
|
130
112
|
|
|
@@ -199,7 +181,7 @@ aicommits config set api-key=<your-api-key>
|
|
|
199
181
|
You can also set multiple configuration options at once by separating them with spaces, like
|
|
200
182
|
|
|
201
183
|
```sh
|
|
202
|
-
aicommits config set api-key=<your-api-key> generate=3
|
|
184
|
+
aicommits config set api-key=<your-api-key> generate=3
|
|
203
185
|
```
|
|
204
186
|
|
|
205
187
|
### Options
|
|
@@ -207,13 +189,13 @@ aicommits config set api-key=<your-api-key> generate=3 locale=en
|
|
|
207
189
|
|
|
208
190
|
Required
|
|
209
191
|
|
|
210
|
-
API key for your
|
|
192
|
+
API key for your configured API provider.
|
|
211
193
|
|
|
212
194
|
#### base-url
|
|
213
195
|
|
|
214
196
|
Required
|
|
215
197
|
|
|
216
|
-
Base URL used for
|
|
198
|
+
Base URL used for API requests.
|
|
217
199
|
|
|
218
200
|
```sh
|
|
219
201
|
aicommits config set base-url=https://api.openai.com/v1
|
|
@@ -242,13 +224,6 @@ model = "gpt-5.2-codex"
|
|
|
242
224
|
base-url = "https://api.example.com/v1"
|
|
243
225
|
```
|
|
244
226
|
|
|
245
|
-
#### locale
|
|
246
|
-
Default: `en`
|
|
247
|
-
|
|
248
|
-
The locale to use for the generated commit messages. Consult the list of codes in: https://wikipedia.org/wiki/List_of_ISO_639-1_codes.
|
|
249
|
-
|
|
250
|
-
Common aliases are normalized automatically (for example `cn` -> `zh-CN`).
|
|
251
|
-
|
|
252
227
|
#### generate
|
|
253
228
|
|
|
254
229
|
Default: `1`
|
|
@@ -271,7 +246,20 @@ aicommits config set proxy=
|
|
|
271
246
|
|
|
272
247
|
Default: `gpt-3.5-turbo`
|
|
273
248
|
|
|
274
|
-
The
|
|
249
|
+
The model to use for generation.
|
|
250
|
+
|
|
251
|
+
#### api-mode
|
|
252
|
+
|
|
253
|
+
Default: `responses`
|
|
254
|
+
|
|
255
|
+
Controls which API primitive aicommits uses.
|
|
256
|
+
|
|
257
|
+
- `responses`: default and recommended for new setups
|
|
258
|
+
- `chat`: legacy compatibility mode
|
|
259
|
+
|
|
260
|
+
```sh
|
|
261
|
+
aicommits config set api-mode=chat
|
|
262
|
+
```
|
|
275
263
|
|
|
276
264
|
|
|
277
265
|
#### timeout
|
|
@@ -308,59 +296,24 @@ Use `0` to switch back to auto mode:
|
|
|
308
296
|
aicommits config set context-window=0
|
|
309
297
|
```
|
|
310
298
|
|
|
311
|
-
####
|
|
312
|
-
Guidance target for commit title length.
|
|
313
|
-
|
|
314
|
-
Default: `50`
|
|
315
|
-
|
|
316
|
-
```sh
|
|
317
|
-
aicommits config set title-length-guide=100
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
`max-length` is kept as a compatibility alias.
|
|
321
|
-
|
|
322
|
-
#### type
|
|
323
|
-
|
|
324
|
-
Default: plain format
|
|
325
|
-
|
|
326
|
-
Set commit type formatting:
|
|
327
|
-
|
|
328
|
-
```sh
|
|
329
|
-
aicommits config set type=conventional
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
#### details
|
|
299
|
+
#### message-path
|
|
333
300
|
|
|
334
|
-
Default: `
|
|
301
|
+
Default: `message.md`
|
|
335
302
|
|
|
336
|
-
|
|
303
|
+
Relative paths resolve from `~/.aicommits/`. The referenced Markdown file controls how commit messages should be written.
|
|
337
304
|
|
|
338
305
|
```sh
|
|
339
|
-
aicommits config set
|
|
306
|
+
aicommits config set message-path=release-message.md
|
|
340
307
|
```
|
|
341
308
|
|
|
342
|
-
####
|
|
343
|
-
|
|
344
|
-
Default: `paragraph`
|
|
309
|
+
#### post-response-script
|
|
345
310
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
Allowed values: `paragraph`, `list`, `markdown`
|
|
349
|
-
|
|
350
|
-
```sh
|
|
351
|
-
aicommits config set details-style=list
|
|
352
|
-
aicommits config set details-style=markdown
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
#### detail-column-guide
|
|
356
|
-
|
|
357
|
-
Default: `72`
|
|
311
|
+
Default: empty
|
|
358
312
|
|
|
359
|
-
|
|
360
|
-
Applies to `paragraph` and `list` styles. `markdown` style keeps original line breaks.
|
|
313
|
+
Relative paths resolve from `~/.aicommits/`. The executable receives the AI response on stdin and must write the final commit message to stdout.
|
|
361
314
|
|
|
362
315
|
```sh
|
|
363
|
-
aicommits config set
|
|
316
|
+
aicommits config set post-response-script=rewrite-message.sh
|
|
364
317
|
```
|
|
365
318
|
|
|
366
319
|
#### show-reasoning
|
|
@@ -368,7 +321,7 @@ aicommits config set detail-column-guide=88
|
|
|
368
321
|
Default: `false`
|
|
369
322
|
|
|
370
323
|
By default, aicommits shows normal analyzing progress.
|
|
371
|
-
If the
|
|
324
|
+
If the API emits reasoning content, it switches to elapsed thinking time (for example `The AI (gpt-5.4) is thinking for 1m 12s`).
|
|
372
325
|
Enable this option to print full streamed model reasoning (debug mode):
|
|
373
326
|
|
|
374
327
|
```sh
|
|
@@ -381,55 +334,36 @@ Or enable for a single run:
|
|
|
381
334
|
aicommits --show-reasoning
|
|
382
335
|
```
|
|
383
336
|
|
|
384
|
-
####
|
|
337
|
+
#### reasoning-effort
|
|
385
338
|
|
|
386
|
-
Default:
|
|
387
|
-
|
|
388
|
-
Additional custom prompt instructions:
|
|
389
|
-
|
|
390
|
-
```sh
|
|
391
|
-
aicommits config set instructions="Use short and direct wording"
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
#### conventional-format
|
|
395
|
-
|
|
396
|
-
Default: `<type>[optional (<scope>)]: <commit message>`
|
|
339
|
+
Default: unset
|
|
397
340
|
|
|
398
|
-
|
|
341
|
+
Controls the model reasoning effort requested by aicommits.
|
|
399
342
|
|
|
400
|
-
|
|
401
|
-
aicommits config set conventional-format="<type>(<scope>): <subject>"
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
#### conventional-types
|
|
405
|
-
|
|
406
|
-
Default: built-in conventional type map
|
|
343
|
+
- `none`, `low`, `medium`, `high`, `xhigh`: request an explicit reasoning level
|
|
407
344
|
|
|
408
|
-
|
|
345
|
+
This is the supported way to configure reasoning effort.
|
|
346
|
+
aicommits maps it to `reasoning.effort` for Responses API requests and `reasoning_effort` for Chat requests.
|
|
409
347
|
|
|
410
348
|
```sh
|
|
411
|
-
aicommits config set
|
|
349
|
+
aicommits config set reasoning-effort=low
|
|
412
350
|
```
|
|
413
351
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
Default: `false`
|
|
417
|
-
|
|
418
|
-
When enabled, conventional commits strongly prefer `type(scope): subject` using the primary file/class/module as scope.
|
|
419
|
-
When disabled (default), conventional commits prefer `type: subject`.
|
|
352
|
+
Or for a single run:
|
|
420
353
|
|
|
421
354
|
```sh
|
|
422
|
-
aicommits
|
|
355
|
+
aicommits --reasoning-effort high
|
|
423
356
|
```
|
|
424
357
|
|
|
425
358
|
#### request-options
|
|
426
359
|
|
|
427
360
|
Default: empty
|
|
428
361
|
|
|
429
|
-
Raw JSON object merged into the
|
|
362
|
+
Raw JSON object merged into the selected API request body.
|
|
430
363
|
|
|
431
|
-
Use this for provider-specific fields
|
|
432
|
-
|
|
364
|
+
Use this for provider-specific fields that do not already have a dedicated aicommits option.
|
|
365
|
+
For reasoning effort, prefer `reasoning-effort` instead of passing `reasoning` or `reasoning_effort` manually.
|
|
366
|
+
Internal fields `model`, `messages`, `instructions`, `input`, and `stream` are controlled by aicommits and cannot be overridden.
|
|
433
367
|
|
|
434
368
|
```sh
|
|
435
369
|
aicommits config set request-options='{"thinking":{"type":"disabled"}}'
|
|
@@ -437,7 +371,7 @@ aicommits config set request-options='{"thinking":{"type":"disabled"}}'
|
|
|
437
371
|
|
|
438
372
|
## How it works
|
|
439
373
|
|
|
440
|
-
This CLI tool runs `git diff` to grab your latest code changes, sends them to your configured
|
|
374
|
+
This CLI tool runs `git diff` to grab your latest code changes, sends them to your configured API provider using the Responses API by default, then returns the generated commit message. You can switch back to Chat Completions with `api-mode=chat`.
|
|
441
375
|
|
|
442
376
|
Video coming soon where I rebuild it from scratch to show you how to easily build your own CLI tools powered by AI.
|
|
443
377
|
|