@kud/ai-conventional-commit-cli 0.2.0 → 0.2.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.
- package/README.md +1 -7
- package/dist/index.cjs +7 -7
- package/dist/index.js +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Opinionated, style-aware AI assistant for crafting, splitting, and refining git commit messages via the local `opencode` CLI. Uses your installed `opencode` models (default `github-copilot/gpt-5`).
|
|
4
4
|
|
|
5
|
-
Formerly referenced as `aicc` in examples. The canonical command name is now `ai-conventional-commit`.
|
|
6
|
-
|
|
7
5
|
## Why
|
|
8
6
|
|
|
9
7
|
Manual commit messages are noisy, inconsistent, and often miss context. ai-conventional-commit inspects your staged diff, learns your repo's commit style, and produces Conventional Commit messages (single or split) with explanations—optionally decorated with gitmoji.
|
|
@@ -33,14 +31,12 @@ ai-conventional-commit --help
|
|
|
33
31
|
|
|
34
32
|
### Optional Alias (Short Name)
|
|
35
33
|
|
|
36
|
-
If you prefer
|
|
34
|
+
If you prefer a shorter alias, add this to your shell profile:
|
|
37
35
|
|
|
38
36
|
```bash
|
|
39
37
|
alias aicc='ai-conventional-commit'
|
|
40
38
|
```
|
|
41
39
|
|
|
42
|
-
After that you can type `aicc` instead of the full command. All subsequent examples use the full name for clarity.
|
|
43
|
-
|
|
44
40
|
## Publishing
|
|
45
41
|
|
|
46
42
|
A build is automatically produced on `npm publish` via the `prepublishOnly` script so you can simply bump the version and run:
|
|
@@ -55,8 +51,6 @@ Only `dist`, `README.md`, and `LICENSE` are included in the published package (s
|
|
|
55
51
|
npm publish --dry-run
|
|
56
52
|
```
|
|
57
53
|
|
|
58
|
-
The shorter `aicc` binary has been removed from the package itself; create a local alias if you still prefer it.
|
|
59
|
-
|
|
60
54
|
## Quick Start
|
|
61
55
|
|
|
62
56
|
```bash
|
package/dist/index.cjs
CHANGED
|
@@ -296,7 +296,7 @@ var OpenCodeProvider = class {
|
|
|
296
296
|
Context:
|
|
297
297
|
${userAggregate}`;
|
|
298
298
|
if (mockMode) {
|
|
299
|
-
if (debug) console.error("[
|
|
299
|
+
if (debug) console.error("[ai-cc][mock] Returning deterministic mock response");
|
|
300
300
|
return JSON.stringify({
|
|
301
301
|
commits: [
|
|
302
302
|
{
|
|
@@ -327,7 +327,7 @@ ${userAggregate}`;
|
|
|
327
327
|
const elapsed = Date.now() - start;
|
|
328
328
|
if (debug) {
|
|
329
329
|
console.error(
|
|
330
|
-
`[
|
|
330
|
+
`[ai-cc][provider] model=${this.model} elapsedMs=${elapsed} promptChars=${fullPrompt.length} bytesOut=${value.length}`
|
|
331
331
|
);
|
|
332
332
|
}
|
|
333
333
|
resolve3(value);
|
|
@@ -340,7 +340,7 @@ ${userAggregate}`;
|
|
|
340
340
|
const candidate = acc.slice(first, last + 1).trim();
|
|
341
341
|
try {
|
|
342
342
|
JSON.parse(candidate);
|
|
343
|
-
if (debug) console.error("[
|
|
343
|
+
if (debug) console.error("[ai-cc][provider] eager JSON detected, terminating process");
|
|
344
344
|
subprocess.kill("SIGTERM");
|
|
345
345
|
finish(candidate);
|
|
346
346
|
} catch {
|
|
@@ -353,7 +353,7 @@ ${userAggregate}`;
|
|
|
353
353
|
tryEager();
|
|
354
354
|
});
|
|
355
355
|
subprocess.stderr?.on("data", (chunk) => {
|
|
356
|
-
if (debug) console.error("[
|
|
356
|
+
if (debug) console.error("[ai-cc][provider][stderr]", chunk.toString().trim());
|
|
357
357
|
});
|
|
358
358
|
subprocess.then(({ stdout }) => {
|
|
359
359
|
if (!resolved) finish(stdout);
|
|
@@ -365,7 +365,7 @@ ${userAggregate}`;
|
|
|
365
365
|
new Error(`Model call timed out after ${timeoutMs}ms (elapsed=${elapsed}ms)`)
|
|
366
366
|
);
|
|
367
367
|
}
|
|
368
|
-
if (debug) console.error("[
|
|
368
|
+
if (debug) console.error("[ai-cc][provider] failure", e.stderr || e.message);
|
|
369
369
|
reject(new Error(e.stderr || e.message || "opencode invocation failed"));
|
|
370
370
|
});
|
|
371
371
|
});
|
|
@@ -1015,8 +1015,8 @@ var RefineCommand = class extends import_clipanion.Command {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
};
|
|
1017
1017
|
var cli = new import_clipanion.Cli({
|
|
1018
|
-
binaryLabel: "
|
|
1019
|
-
binaryName: "
|
|
1018
|
+
binaryLabel: "ai-conventional-commit",
|
|
1019
|
+
binaryName: "ai-conventional-commit",
|
|
1020
1020
|
binaryVersion: "0.1.0"
|
|
1021
1021
|
});
|
|
1022
1022
|
cli.register(GenerateCommand);
|
package/dist/index.js
CHANGED
|
@@ -273,7 +273,7 @@ var OpenCodeProvider = class {
|
|
|
273
273
|
Context:
|
|
274
274
|
${userAggregate}`;
|
|
275
275
|
if (mockMode) {
|
|
276
|
-
if (debug) console.error("[
|
|
276
|
+
if (debug) console.error("[ai-cc][mock] Returning deterministic mock response");
|
|
277
277
|
return JSON.stringify({
|
|
278
278
|
commits: [
|
|
279
279
|
{
|
|
@@ -304,7 +304,7 @@ ${userAggregate}`;
|
|
|
304
304
|
const elapsed = Date.now() - start;
|
|
305
305
|
if (debug) {
|
|
306
306
|
console.error(
|
|
307
|
-
`[
|
|
307
|
+
`[ai-cc][provider] model=${this.model} elapsedMs=${elapsed} promptChars=${fullPrompt.length} bytesOut=${value.length}`
|
|
308
308
|
);
|
|
309
309
|
}
|
|
310
310
|
resolve3(value);
|
|
@@ -317,7 +317,7 @@ ${userAggregate}`;
|
|
|
317
317
|
const candidate = acc.slice(first, last + 1).trim();
|
|
318
318
|
try {
|
|
319
319
|
JSON.parse(candidate);
|
|
320
|
-
if (debug) console.error("[
|
|
320
|
+
if (debug) console.error("[ai-cc][provider] eager JSON detected, terminating process");
|
|
321
321
|
subprocess.kill("SIGTERM");
|
|
322
322
|
finish(candidate);
|
|
323
323
|
} catch {
|
|
@@ -330,7 +330,7 @@ ${userAggregate}`;
|
|
|
330
330
|
tryEager();
|
|
331
331
|
});
|
|
332
332
|
subprocess.stderr?.on("data", (chunk) => {
|
|
333
|
-
if (debug) console.error("[
|
|
333
|
+
if (debug) console.error("[ai-cc][provider][stderr]", chunk.toString().trim());
|
|
334
334
|
});
|
|
335
335
|
subprocess.then(({ stdout }) => {
|
|
336
336
|
if (!resolved) finish(stdout);
|
|
@@ -342,7 +342,7 @@ ${userAggregate}`;
|
|
|
342
342
|
new Error(`Model call timed out after ${timeoutMs}ms (elapsed=${elapsed}ms)`)
|
|
343
343
|
);
|
|
344
344
|
}
|
|
345
|
-
if (debug) console.error("[
|
|
345
|
+
if (debug) console.error("[ai-cc][provider] failure", e.stderr || e.message);
|
|
346
346
|
reject(new Error(e.stderr || e.message || "opencode invocation failed"));
|
|
347
347
|
});
|
|
348
348
|
});
|
|
@@ -992,8 +992,8 @@ var RefineCommand = class extends Command {
|
|
|
992
992
|
}
|
|
993
993
|
};
|
|
994
994
|
var cli = new Cli({
|
|
995
|
-
binaryLabel: "
|
|
996
|
-
binaryName: "
|
|
995
|
+
binaryLabel: "ai-conventional-commit",
|
|
996
|
+
binaryName: "ai-conventional-commit",
|
|
997
997
|
binaryVersion: "0.1.0"
|
|
998
998
|
});
|
|
999
999
|
cli.register(GenerateCommand);
|
package/package.json
CHANGED