@sugarmo/aicommits 1.14.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 +52 -98
- package/dist/cli.mjs +114 -113
- 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,44 +80,34 @@ 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
|
-
|
|
100
|
-
|
|
101
|
-
The generator uses a GitHub Copilot-like style by default and prefers commit titles with a concrete file/class/module anchor so commit lists are easier to scan.
|
|
102
|
-
|
|
103
|
-
You can still fine-tune output using custom instructions:
|
|
93
|
+
To use a different Markdown file for one run:
|
|
104
94
|
|
|
105
95
|
```sh
|
|
106
|
-
aicommits --
|
|
96
|
+
aicommits --message-file release-message.md
|
|
107
97
|
```
|
|
108
98
|
|
|
109
|
-
|
|
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.
|
|
110
100
|
|
|
111
|
-
|
|
101
|
+
#### Post-process the AI response
|
|
112
102
|
|
|
113
|
-
|
|
114
|
-
aicommits --type conventional --conventional-format "<type>(<scope>): <subject>" --conventional-types '{"feature":"Introduce a feature","bugfix":"Fix defects"}'
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
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:
|
|
103
|
+
You can run an executable after the model responds and before the message is shown or committed.
|
|
118
104
|
|
|
119
105
|
```sh
|
|
120
|
-
aicommits --
|
|
106
|
+
aicommits --post-response-script rewrite-message.sh
|
|
121
107
|
```
|
|
122
108
|
|
|
109
|
+
The script receives the raw AI message on stdin and must write the final message to stdout.
|
|
110
|
+
|
|
123
111
|
### Git hook
|
|
124
112
|
|
|
125
113
|
You can also integrate _aicommits_ with Git via the [`prepare-commit-msg`](https://git-scm.com/docs/githooks#_prepare_commit_msg) hook. This lets you use Git like you normally would, and edit the commit message before committing.
|
|
@@ -193,7 +181,7 @@ aicommits config set api-key=<your-api-key>
|
|
|
193
181
|
You can also set multiple configuration options at once by separating them with spaces, like
|
|
194
182
|
|
|
195
183
|
```sh
|
|
196
|
-
aicommits config set api-key=<your-api-key> generate=3
|
|
184
|
+
aicommits config set api-key=<your-api-key> generate=3
|
|
197
185
|
```
|
|
198
186
|
|
|
199
187
|
### Options
|
|
@@ -201,13 +189,13 @@ aicommits config set api-key=<your-api-key> generate=3 locale=en
|
|
|
201
189
|
|
|
202
190
|
Required
|
|
203
191
|
|
|
204
|
-
API key for your
|
|
192
|
+
API key for your configured API provider.
|
|
205
193
|
|
|
206
194
|
#### base-url
|
|
207
195
|
|
|
208
196
|
Required
|
|
209
197
|
|
|
210
|
-
Base URL used for
|
|
198
|
+
Base URL used for API requests.
|
|
211
199
|
|
|
212
200
|
```sh
|
|
213
201
|
aicommits config set base-url=https://api.openai.com/v1
|
|
@@ -236,13 +224,6 @@ model = "gpt-5.2-codex"
|
|
|
236
224
|
base-url = "https://api.example.com/v1"
|
|
237
225
|
```
|
|
238
226
|
|
|
239
|
-
#### locale
|
|
240
|
-
Default: `en`
|
|
241
|
-
|
|
242
|
-
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.
|
|
243
|
-
|
|
244
|
-
Common aliases are normalized automatically (for example `cn` -> `zh-CN`).
|
|
245
|
-
|
|
246
227
|
#### generate
|
|
247
228
|
|
|
248
229
|
Default: `1`
|
|
@@ -265,7 +246,20 @@ aicommits config set proxy=
|
|
|
265
246
|
|
|
266
247
|
Default: `gpt-3.5-turbo`
|
|
267
248
|
|
|
268
|
-
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
|
+
```
|
|
269
263
|
|
|
270
264
|
|
|
271
265
|
#### timeout
|
|
@@ -302,45 +296,24 @@ Use `0` to switch back to auto mode:
|
|
|
302
296
|
aicommits config set context-window=0
|
|
303
297
|
```
|
|
304
298
|
|
|
305
|
-
####
|
|
306
|
-
The maximum character length of the generated commit message.
|
|
307
|
-
|
|
308
|
-
Default: `50`
|
|
309
|
-
|
|
310
|
-
```sh
|
|
311
|
-
aicommits config set max-length=100
|
|
312
|
-
```
|
|
299
|
+
#### message-path
|
|
313
300
|
|
|
314
|
-
|
|
301
|
+
Default: `message.md`
|
|
315
302
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
Set commit type formatting:
|
|
319
|
-
|
|
320
|
-
```sh
|
|
321
|
-
aicommits config set type=conventional
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
#### details
|
|
325
|
-
|
|
326
|
-
Default: `false`
|
|
327
|
-
|
|
328
|
-
Set this to `true` to allow optional body details. If the title already explains the change clearly, it can still return title only:
|
|
303
|
+
Relative paths resolve from `~/.aicommits/`. The referenced Markdown file controls how commit messages should be written.
|
|
329
304
|
|
|
330
305
|
```sh
|
|
331
|
-
aicommits config set
|
|
306
|
+
aicommits config set message-path=release-message.md
|
|
332
307
|
```
|
|
333
308
|
|
|
334
|
-
####
|
|
335
|
-
|
|
336
|
-
Default: `paragraph`
|
|
309
|
+
#### post-response-script
|
|
337
310
|
|
|
338
|
-
|
|
311
|
+
Default: empty
|
|
339
312
|
|
|
340
|
-
|
|
313
|
+
Relative paths resolve from `~/.aicommits/`. The executable receives the AI response on stdin and must write the final commit message to stdout.
|
|
341
314
|
|
|
342
315
|
```sh
|
|
343
|
-
aicommits config set
|
|
316
|
+
aicommits config set post-response-script=rewrite-message.sh
|
|
344
317
|
```
|
|
345
318
|
|
|
346
319
|
#### show-reasoning
|
|
@@ -348,7 +321,7 @@ aicommits config set details-style=list
|
|
|
348
321
|
Default: `false`
|
|
349
322
|
|
|
350
323
|
By default, aicommits shows normal analyzing progress.
|
|
351
|
-
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`).
|
|
352
325
|
Enable this option to print full streamed model reasoning (debug mode):
|
|
353
326
|
|
|
354
327
|
```sh
|
|
@@ -361,55 +334,36 @@ Or enable for a single run:
|
|
|
361
334
|
aicommits --show-reasoning
|
|
362
335
|
```
|
|
363
336
|
|
|
364
|
-
####
|
|
365
|
-
|
|
366
|
-
Default: empty
|
|
367
|
-
|
|
368
|
-
Additional custom prompt instructions:
|
|
369
|
-
|
|
370
|
-
```sh
|
|
371
|
-
aicommits config set instructions="Use short and direct wording"
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
#### conventional-format
|
|
375
|
-
|
|
376
|
-
Default: `<type>[optional (<scope>)]: <commit message>`
|
|
337
|
+
#### reasoning-effort
|
|
377
338
|
|
|
378
|
-
|
|
339
|
+
Default: unset
|
|
379
340
|
|
|
380
|
-
|
|
381
|
-
aicommits config set conventional-format="<type>(<scope>): <subject>"
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
#### conventional-types
|
|
341
|
+
Controls the model reasoning effort requested by aicommits.
|
|
385
342
|
|
|
386
|
-
|
|
343
|
+
- `none`, `low`, `medium`, `high`, `xhigh`: request an explicit reasoning level
|
|
387
344
|
|
|
388
|
-
|
|
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.
|
|
389
347
|
|
|
390
348
|
```sh
|
|
391
|
-
aicommits config set
|
|
349
|
+
aicommits config set reasoning-effort=low
|
|
392
350
|
```
|
|
393
351
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
Default: `false`
|
|
397
|
-
|
|
398
|
-
When enabled, conventional commits strongly prefer `type(scope): subject` using the primary file/class/module as scope.
|
|
399
|
-
When disabled (default), conventional commits prefer `type: subject`.
|
|
352
|
+
Or for a single run:
|
|
400
353
|
|
|
401
354
|
```sh
|
|
402
|
-
aicommits
|
|
355
|
+
aicommits --reasoning-effort high
|
|
403
356
|
```
|
|
404
357
|
|
|
405
358
|
#### request-options
|
|
406
359
|
|
|
407
360
|
Default: empty
|
|
408
361
|
|
|
409
|
-
Raw JSON object merged into the
|
|
362
|
+
Raw JSON object merged into the selected API request body.
|
|
410
363
|
|
|
411
|
-
Use this for provider-specific fields
|
|
412
|
-
|
|
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.
|
|
413
367
|
|
|
414
368
|
```sh
|
|
415
369
|
aicommits config set request-options='{"thinking":{"type":"disabled"}}'
|
|
@@ -417,7 +371,7 @@ aicommits config set request-options='{"thinking":{"type":"disabled"}}'
|
|
|
417
371
|
|
|
418
372
|
## How it works
|
|
419
373
|
|
|
420
|
-
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`.
|
|
421
375
|
|
|
422
376
|
Video coming soon where I rebuild it from scratch to show you how to easily build your own CLI tools powered by AI.
|
|
423
377
|
|