@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.
Files changed (3) hide show
  1. package/README.md +51 -117
  2. package/dist/cli.mjs +114 -121
  3. 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
- #### Generate title + optional details
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
- ```sh
90
- aicommits --details
91
- ```
85
+ Commit message style is now controlled by a Markdown file instead of individual formatting flags.
92
86
 
93
- If you prefer a bullet-list body style:
87
+ By default, aicommits reads `~/.aicommits/message.md`. The file is created automatically on first use.
94
88
 
95
89
  ```sh
96
- aicommits --details --details-style list
90
+ aicommits
97
91
  ```
98
92
 
99
- If you prefer markdown-formatted detail body:
93
+ To use a different Markdown file for one run:
100
94
 
101
95
  ```sh
102
- aicommits --details --details-style markdown
96
+ aicommits --message-file release-message.md
103
97
  ```
104
98
 
105
- #### Default style
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
- 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.
101
+ #### Post-process the AI response
108
102
 
109
- You can still fine-tune output using custom instructions:
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 --details --instructions "Use shorter body sentences and prioritize class names in the title"
106
+ aicommits --post-response-script rewrite-message.sh
113
107
  ```
114
108
 
115
- #### Customize conventional format
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 locale=en
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 chat completions provider.
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 chat completions requests.
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 Chat Completions (`/v1/chat/completions`) model to use.
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
- #### title-length-guide
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: `false`
301
+ Default: `message.md`
335
302
 
336
- 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.
337
304
 
338
305
  ```sh
339
- aicommits config set details=true
306
+ aicommits config set message-path=release-message.md
340
307
  ```
341
308
 
342
- #### details-style
343
-
344
- Default: `paragraph`
309
+ #### post-response-script
345
310
 
346
- Controls body formatting when `details=true`.
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
- Guidance target for where detail/body lines should wrap.
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 detail-column-guide=88
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 model emits reasoning tokens, it switches to elapsed thinking time (for example `Thinking for 1m 12s`).
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
- #### instructions
337
+ #### reasoning-effort
385
338
 
386
- Default: empty
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
- Customize the conventional output template:
341
+ Controls the model reasoning effort requested by aicommits.
399
342
 
400
- ```sh
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
- Customize type descriptions with JSON:
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 conventional-types='{"feature":"Introduce a feature","bugfix":"Fix defects"}'
349
+ aicommits config set reasoning-effort=low
412
350
  ```
413
351
 
414
- #### conventional-scope
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 config set conventional-scope=true
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 Chat Completions request body.
362
+ Raw JSON object merged into the selected API request body.
430
363
 
431
- Use this for provider-specific fields (for example, disabling reasoning/thinking when supported).
432
- Internal fields `model`, `messages`, and `stream` are controlled by aicommits and cannot be overridden.
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 chat completions API, then returns the generated commit message.
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