@synmux/claude-commit 1.0.4 → 1.1.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/CHANGELOG.md +34 -0
- package/README.md +58 -39
- package/bin/cco.js +16 -0
- package/bin/cco.ts +3 -6
- package/dist/bin/cco.js +2347 -0
- package/dist/index.js +1642 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/src/agent.d.ts +93 -0
- package/dist/types/src/config.d.ts +36 -0
- package/dist/types/src/diff.d.ts +115 -0
- package/{src/errors.ts → dist/types/src/errors.d.ts} +3 -6
- package/dist/types/src/generate.d.ts +113 -0
- package/dist/types/src/git.d.ts +31 -0
- package/dist/types/src/models.d.ts +42 -0
- package/dist/types/src/ollama.d.ts +89 -0
- package/dist/types/src/paths.d.ts +9 -0
- package/dist/types/src/prompts.d.ts +59 -0
- package/dist/types/src/tokens.d.ts +58 -0
- package/dist/types/src/types.d.ts +234 -0
- package/{src/ui/colors.ts → dist/types/src/ui/colors.d.ts} +2 -5
- package/dist/types/src/ui/spinner.d.ts +23 -0
- package/package.json +42 -31
- package/index.ts +0 -71
- package/src/agent.ts +0 -280
- package/src/cli.ts +0 -448
- package/src/config.ts +0 -339
- package/src/diff.ts +0 -580
- package/src/generate.ts +0 -501
- package/src/git.ts +0 -145
- package/src/models.ts +0 -95
- package/src/ollama.ts +0 -502
- package/src/paths.ts +0 -139
- package/src/prompts.ts +0 -407
- package/src/tokens.ts +0 -147
- package/src/types.ts +0 -244
- package/src/ui/editor.ts +0 -89
- package/src/ui/interactive.ts +0 -313
- package/src/ui/spinner.ts +0 -79
- package/src/utils.ts +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,40 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
Each version also has a [GitHub release](https://github.com/synmux/claude-commit/releases)
|
|
8
8
|
carrying the same notes at greater length.
|
|
9
9
|
|
|
10
|
+
## [1.1.0] - 2026-09-13
|
|
11
|
+
|
|
12
|
+
### [1.1.0] - Changed
|
|
13
|
+
|
|
14
|
+
- **Runs on Node, not Bun.** `cco` now requires Node.js 22.18 or later
|
|
15
|
+
(24 LTS recommended) and no longer needs Bun at all. The package ships a
|
|
16
|
+
bundled `dist/` built with esbuild plus type declarations for the library
|
|
17
|
+
entry; the executable is `bin/cco.js`, which runs the TypeScript sources
|
|
18
|
+
directly from a checkout via Node's native type stripping.
|
|
19
|
+
- **The interactive picker is built on Clack** (`@clack/core` +
|
|
20
|
+
`@clack/prompts`) instead of OpenTUI. It looks a little different - a
|
|
21
|
+
title, a hint line, and every candidate shown as its subject plus a
|
|
22
|
+
one-line body preview - and gains `j`/`k` navigation with wrapping and
|
|
23
|
+
`Ctrl-C` to cancel alongside the existing arrow keys, `Enter`, `e` and
|
|
24
|
+
`q`/`Esc`. The list windows itself to the terminal height. It still draws
|
|
25
|
+
on stderr only.
|
|
26
|
+
- Path patterns (`lowPriorityPaths`, `ignore`) are matched by `picomatch`
|
|
27
|
+
instead of `Bun.Glob`. Every well-formed pattern behaves exactly as
|
|
28
|
+
before. Two ill-formed cases differ: an unbalanced `{` now matches
|
|
29
|
+
nothing (it used to match its first alternative), and an unterminated `[`
|
|
30
|
+
now matches its literal text (it used to match nothing).
|
|
31
|
+
- Development moved to pnpm (`pnpm-lock.yaml`, `pnpm-workspace.yaml`),
|
|
32
|
+
vitest (`pnpm test`) and esbuild (`pnpm run build`). The repository's own
|
|
33
|
+
`lowPriorityPaths` deprioritise `pnpm-lock.yaml` instead of `bun.lock`.
|
|
34
|
+
- The npm publish workflow now runs `ci.yml` (lint, typecheck, build, test)
|
|
35
|
+
as a reusable workflow against the tagged commit and only publishes once
|
|
36
|
+
it succeeds. It no longer carries its own test step, which had been
|
|
37
|
+
calling a `typecheck` script that no longer exists.
|
|
38
|
+
|
|
39
|
+
### [1.1.0] - Removed
|
|
40
|
+
|
|
41
|
+
- The `@opentui/core` and `@types/bun` dependencies, `bun.lock`, and the Bun
|
|
42
|
+
pin in `mise.toml` (now Node 24.20.0).
|
|
43
|
+
|
|
10
44
|
## [1.0.4] - 2026-09-11
|
|
11
45
|
|
|
12
46
|
### [1.0.4] - Added
|
package/README.md
CHANGED
|
@@ -44,17 +44,24 @@ For less model work at the cost of less useful messages, enable
|
|
|
44
44
|
|
|
45
45
|
## Install
|
|
46
46
|
|
|
47
|
-
Requires [
|
|
47
|
+
Requires [Node.js](https://nodejs.org) 22.18 or later (24 LTS recommended).
|
|
48
48
|
|
|
49
49
|
```sh
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
npm install -g @synmux/claude-commit # `cco` and `claude-commit` on your PATH
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
From a checkout, [pnpm](https://pnpm.io) is the package manager (the
|
|
54
|
+
`packageManager` field pins the version, so `corepack enable` is enough):
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
pnpm install
|
|
58
|
+
pnpm link --global # makes `cco` and `claude-commit` available on your PATH
|
|
52
59
|
```
|
|
53
60
|
|
|
54
61
|
Or run it directly without linking:
|
|
55
62
|
|
|
56
63
|
```sh
|
|
57
|
-
|
|
64
|
+
node bin/cco.js --help
|
|
58
65
|
```
|
|
59
66
|
|
|
60
67
|
## Authentication
|
|
@@ -88,29 +95,29 @@ and asks for confirmation before committing. Pass `-y` to skip the prompt, or
|
|
|
88
95
|
|
|
89
96
|
### Options
|
|
90
97
|
|
|
91
|
-
| Flag | Description
|
|
92
|
-
| ---------------------------------------- |
|
|
93
|
-
| `-i, --interactive` / `--no-interactive` | Choose between several options in an interactive
|
|
94
|
-
| `-n, --count <n>` | Number of options to generate in interactive mode (default 3)
|
|
95
|
-
| `-a, --all` | Stage all changes (`git add -A`) before committing
|
|
96
|
-
| `-c, --conventional` | Format as a [Conventional Commit](https://www.conventionalcommits.org)
|
|
97
|
-
| `-g, --gitmoji` | Prefix the subject with a [gitmoji](https://gitmoji.dev)
|
|
98
|
-
| `-m, --multiline` / `--no-multiline` | Write a multi-line commit (subject + body), or force a single line
|
|
99
|
-
| `-t, --template <tpl>` | Template for the first line, e.g. `"[PROJ-1] {message}"`
|
|
100
|
-
| `-p, --prompt <text>` | Extra instructions appended to the prompt
|
|
101
|
-
| `-f, --filenames-only` | Skip summarisation and send only filenames to the final model
|
|
102
|
-
| `--model-summary <model>` | Model used to summarize the diff (default `sonnet`)
|
|
103
|
-
| `--model-final <model>` | Model used to write the message (default `sonnet`)
|
|
104
|
-
| `--skip-armored` | Omit armored/encoded lines (age/gpg armor, base64 blobs) from the summarized diff
|
|
105
|
-
| `--no-low-priority-paths` | Ignore `lowPriorityPaths` for this run, so every change weighs the same
|
|
106
|
-
| `--no-ignore` | Disregard `ignore` for this run, so every staged change is read
|
|
107
|
-
| `--ollama-host <url>` | Base URL of the Ollama server for `ollama:` models
|
|
108
|
-
| `--ollama-context <tokens>` | Context window requested from Ollama models
|
|
109
|
-
| `-d, --dry-run` | Print the message to stdout without committing
|
|
110
|
-
| `-y, --yes` | Commit without asking for confirmation
|
|
111
|
-
| `--no-spinner` | Disable the progress spinner
|
|
112
|
-
| `--config <path>` | Path to a config file
|
|
113
|
-
| `-v, --verbose` | Print summaries, cost and debug output
|
|
98
|
+
| Flag | Description |
|
|
99
|
+
| ---------------------------------------- | ------------------------------------------------------------------------------------------ |
|
|
100
|
+
| `-i, --interactive` / `--no-interactive` | Choose between several options in an interactive picker, or skip it when enabled in config |
|
|
101
|
+
| `-n, --count <n>` | Number of options to generate in interactive mode (default 3) |
|
|
102
|
+
| `-a, --all` | Stage all changes (`git add -A`) before committing |
|
|
103
|
+
| `-c, --conventional` | Format as a [Conventional Commit](https://www.conventionalcommits.org) |
|
|
104
|
+
| `-g, --gitmoji` | Prefix the subject with a [gitmoji](https://gitmoji.dev) |
|
|
105
|
+
| `-m, --multiline` / `--no-multiline` | Write a multi-line commit (subject + body), or force a single line |
|
|
106
|
+
| `-t, --template <tpl>` | Template for the first line, e.g. `"[PROJ-1] {message}"` |
|
|
107
|
+
| `-p, --prompt <text>` | Extra instructions appended to the prompt |
|
|
108
|
+
| `-f, --filenames-only` | Skip summarisation and send only filenames to the final model |
|
|
109
|
+
| `--model-summary <model>` | Model used to summarize the diff (default `sonnet`) |
|
|
110
|
+
| `--model-final <model>` | Model used to write the message (default `sonnet`) |
|
|
111
|
+
| `--skip-armored` | Omit armored/encoded lines (age/gpg armor, base64 blobs) from the summarized diff |
|
|
112
|
+
| `--no-low-priority-paths` | Ignore `lowPriorityPaths` for this run, so every change weighs the same |
|
|
113
|
+
| `--no-ignore` | Disregard `ignore` for this run, so every staged change is read |
|
|
114
|
+
| `--ollama-host <url>` | Base URL of the Ollama server for `ollama:` models |
|
|
115
|
+
| `--ollama-context <tokens>` | Context window requested from Ollama models |
|
|
116
|
+
| `-d, --dry-run` | Print the message to stdout without committing |
|
|
117
|
+
| `-y, --yes` | Commit without asking for confirmation |
|
|
118
|
+
| `--no-spinner` | Disable the progress spinner |
|
|
119
|
+
| `--config <path>` | Path to a config file |
|
|
120
|
+
| `-v, --verbose` | Print summaries, cost and debug output |
|
|
114
121
|
|
|
115
122
|
### Examples
|
|
116
123
|
|
|
@@ -120,7 +127,7 @@ cco -a -c # stage everything and write a Conventional Commit
|
|
|
120
127
|
cco -c -g -m # conventional + gitmoji + a body
|
|
121
128
|
cco -i -n 5 # pick from 5 options interactively
|
|
122
129
|
cco -f --dry-run # generate from filenames only, without committing
|
|
123
|
-
cco --dry-run | cat # print a message without committing (
|
|
130
|
+
cco --dry-run | cat # print a message without committing (no picker, pipe-safe)
|
|
124
131
|
git commit -F <(cco -d) # use the message with your own git invocation
|
|
125
132
|
```
|
|
126
133
|
|
|
@@ -154,11 +161,13 @@ library results have an empty `summaries` array and `chunkCount: 0`.
|
|
|
154
161
|
|
|
155
162
|
## Interactive mode
|
|
156
163
|
|
|
157
|
-
`cco -i` opens a
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
164
|
+
`cco -i` opens a picker (built on [Clack](https://github.com/bombshell-dev/clack))
|
|
165
|
+
listing several candidate messages, each with its subject and a one-line body
|
|
166
|
+
preview. The options are generated with a higher temperature
|
|
167
|
+
(`interactiveTemperature`) for more variety. Use the arrow keys (or `j`/`k`) to
|
|
168
|
+
move between options, `Enter` to commit the highlighted option, `e` to edit it
|
|
169
|
+
in your `$EDITOR` first, and `q`/`Esc`/`Ctrl-C` to cancel. The picker draws on
|
|
170
|
+
stderr, so stdout stays clean.
|
|
162
171
|
|
|
163
172
|
To make interactive mode the default without typing `-i` every time, set
|
|
164
173
|
`"interactive": true` in your config (see below); opt out of a single run with
|
|
@@ -257,7 +266,12 @@ those paths:
|
|
|
257
266
|
|
|
258
267
|
```json
|
|
259
268
|
{
|
|
260
|
-
"lowPriorityPaths": [
|
|
269
|
+
"lowPriorityPaths": [
|
|
270
|
+
".agents/skills/*-skilld",
|
|
271
|
+
"pnpm-lock.yaml",
|
|
272
|
+
"generated/**",
|
|
273
|
+
"!generated/schema.ts"
|
|
274
|
+
]
|
|
261
275
|
}
|
|
262
276
|
```
|
|
263
277
|
|
|
@@ -275,9 +289,9 @@ usually be copied in:
|
|
|
275
289
|
- A pattern with a `/` in it is anchored at the repository root and matches a
|
|
276
290
|
path or any directory above it - `.agents/skills/*-skilld` covers every file
|
|
277
291
|
inside each matching directory.
|
|
278
|
-
- A pattern without a `/` matches any path segment at any depth -
|
|
279
|
-
matches `packages/app/
|
|
280
|
-
`*-skilld` directory.
|
|
292
|
+
- A pattern without a `/` matches any path segment at any depth -
|
|
293
|
+
`pnpm-lock.yaml` matches `packages/app/pnpm-lock.yaml`; `*-skilld` matches
|
|
294
|
+
everything inside any `*-skilld` directory.
|
|
281
295
|
- `*` matches dotfiles and does not cross `/`; `**` does; `{a,b}` expands. A
|
|
282
296
|
leading `/` or `./` anchors, a trailing `/` is ignored. The anchoring
|
|
283
297
|
decision looks at the whole pattern, so a `/` inside a brace group anchors
|
|
@@ -430,10 +444,15 @@ Where the number comes from is `ollama.context`:
|
|
|
430
444
|
## Development
|
|
431
445
|
|
|
432
446
|
```sh
|
|
433
|
-
|
|
434
|
-
|
|
447
|
+
pnpm test # run the test suite (vitest)
|
|
448
|
+
pnpm run typecheck # tsc --noEmit
|
|
449
|
+
pnpm run build # bundle bin/ and index.ts into dist/ (only needed to publish)
|
|
435
450
|
```
|
|
436
451
|
|
|
452
|
+
The sources run directly on Node's native type stripping, so there is no build
|
|
453
|
+
step during development: `node bin/cco.js` picks up `dist/` when it exists and
|
|
454
|
+
falls back to the TypeScript entry otherwise.
|
|
455
|
+
|
|
437
456
|
What changed between versions is in [CHANGELOG.md](CHANGELOG.md), and at
|
|
438
457
|
greater length on the
|
|
439
458
|
[releases page](https://github.com/synmux/claude-commit/releases).
|
package/bin/cco.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Launcher for `cco` / `claude-commit`.
|
|
4
|
+
*
|
|
5
|
+
* The published package ships a bundled `dist/bin/cco.js` (Node refuses to
|
|
6
|
+
* strip types from files under `node_modules`); a development checkout runs
|
|
7
|
+
* the TypeScript entry directly through Node's native type stripping. Build
|
|
8
|
+
* output wins when present, so `pnpm run build` is only ever needed for
|
|
9
|
+
* publishing.
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync } from "node:fs";
|
|
12
|
+
|
|
13
|
+
const bundled = new URL("../dist/bin/cco.js", import.meta.url);
|
|
14
|
+
const source = new URL("./cco.ts", import.meta.url);
|
|
15
|
+
|
|
16
|
+
await import(existsSync(bundled) ? bundled.href : source.href);
|
package/bin/cco.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
1
|
/**
|
|
3
2
|
* Executable entry point for `cco` / `claude-commit`.
|
|
4
3
|
*/
|
|
5
|
-
import { run } from "../src/cli";
|
|
6
|
-
import { color } from "../src/ui/colors";
|
|
4
|
+
import { run } from "../src/cli.ts";
|
|
5
|
+
import { color } from "../src/ui/colors.ts";
|
|
7
6
|
|
|
8
7
|
run(process.argv.slice(2))
|
|
9
8
|
.then((code) => {
|
|
@@ -11,8 +10,6 @@ run(process.argv.slice(2))
|
|
|
11
10
|
})
|
|
12
11
|
.catch((err) => {
|
|
13
12
|
// Unexpected (non-ClaudeCommitError) failures: print a stack for debugging.
|
|
14
|
-
process.stderr.write(
|
|
15
|
-
`${color("31", "unexpected error:")} ${err?.stack ?? err}\n`,
|
|
16
|
-
);
|
|
13
|
+
process.stderr.write(`${color("31", "unexpected error:")} ${err?.stack ?? err}\n`);
|
|
17
14
|
process.exitCode = 1;
|
|
18
15
|
});
|