codebase-snapshot 0.20.13 → 0.21.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 +33 -6
- package/README.md +41 -19
- package/SECURITY.md +2 -2
- package/dist/bin.js +12482 -10348
- package/dist/{chunk-GNVRD7XS.js → chunk-TDPYLX7X.js} +6062 -4438
- package/dist/cli.cjs +11759 -9645
- package/dist/cli.d.cts +76 -2
- package/dist/cli.d.ts +76 -2
- package/dist/cli.js +549 -14
- package/dist/{generate-worker-DMzNbsAW.d.cts → generate-worker-D56JeXwx.d.cts} +2 -2
- package/dist/{generate-worker-CRMESc0b.d.ts → generate-worker-DakxZs-l.d.ts} +2 -2
- package/dist/index.cjs +6037 -4435
- package/dist/index.d.cts +281 -63
- package/dist/index.d.ts +281 -63
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +10231 -4354
- package/dist/mcp.d.cts +13 -7
- package/dist/mcp.d.ts +13 -7
- package/dist/mcp.js +1 -1
- package/dist/{types-C5ytHMYz.d.ts → types-D5XYzksd.d.cts} +50 -2
- package/dist/{types-C5ytHMYz.d.cts → types-D5XYzksd.d.ts} +50 -2
- package/docs/about.md +86 -0
- package/docs/agent.md +28 -6
- package/docs/answer.md +99 -48
- package/docs/benchmarks.md +34 -34
- package/docs/brief.md +80 -81
- package/docs/cli.md +100 -25
- package/docs/codebase-token-budget.md +14 -13
- package/docs/contents.md +66 -0
- package/docs/deploy.md +2 -2
- package/docs/faq.md +112 -0
- package/docs/glossary.md +152 -0
- package/docs/health.md +1 -1
- package/docs/how-to-feed-a-repo-to-claude.md +6 -0
- package/docs/impact.md +102 -0
- package/docs/install.md +4 -3
- package/docs/llm-codebase-context.md +166 -0
- package/docs/mcp-server-for-codebase.md +155 -0
- package/docs/mcp.md +43 -66
- package/docs/migration.md +83 -90
- package/docs/output.md +1 -3
- package/docs/security-review.md +8 -8
- package/docs/slice.md +1 -1
- package/docs/tools.md +159 -185
- package/docs/troubleshooting.md +11 -11
- package/docs/vs-code2prompt.md +7 -0
- package/docs/vs-gitingest.md +7 -0
- package/docs/vs-repomix.md +10 -1
- package/docs/workspace.md +1 -1
- package/package.json +8 -2
package/docs/benchmarks.md
CHANGED
|
@@ -8,14 +8,14 @@ anyone can run:
|
|
|
8
8
|
node scripts/benchmark.mjs /path/to/repo "the question to slice for"
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
The run below used the default question, on
|
|
12
|
-
tokens in full.
|
|
11
|
+
The run below used the default question, on this repository at **0.21.0 on 2026-11-30**: 221 files,
|
|
12
|
+
764,225 estimated tokens in full.
|
|
13
13
|
|
|
14
14
|
| Mode | Files | Parts | Tokens | vs full | Time |
|
|
15
15
|
| :-- | --: | --: | --: | --: | --: |
|
|
16
|
-
| full |
|
|
17
|
-
| slice |
|
|
18
|
-
| budget (30,000) |
|
|
16
|
+
| full | 221 | 9 | 764,225 | 100% | 2.05 s |
|
|
17
|
+
| slice | 7 | 1 | 63,983 | 8.4% | 1.68 s |
|
|
18
|
+
| budget (30,000) | 22 | 1 | 36,005 | 4.7% | 1.69 s |
|
|
19
19
|
|
|
20
20
|
## What the columns mean
|
|
21
21
|
|
|
@@ -48,22 +48,22 @@ node scripts/benchmark-suite.mjs <url> ... # your own list
|
|
|
48
48
|
|
|
49
49
|
Each repository is cloned shallow into a scratch directory, packed by all three tools, and the
|
|
50
50
|
clone is deleted. A repository that cannot be cloned is reported as skipped with the reason, never
|
|
51
|
-
dropped from the table. Measured at 0.
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
dropped from the table. Measured at **0.21.0 on 2026-11-30**, with repomix 1.19.0 and gitingest from
|
|
52
|
+
PyPI. The shape held; small file-count differences are policy (notably bounded previews), not
|
|
53
|
+
scanner drift.
|
|
54
54
|
|
|
55
55
|
| Repository | Ours files | Ours tokens | repomix tokens | repomix / ours | gitingest bytes |
|
|
56
56
|
| :-- | --: | --: | --: | --: | --: |
|
|
57
|
-
| jonschlinkert/is-odd | 11 | 5,
|
|
57
|
+
| jonschlinkert/is-odd | 11 | 5,447 | 4,291 | 0.79 | 29,392 |
|
|
58
58
|
| chalk/chalk | 32 | 77,684 | 79,006 | 1.02 | 238,864 |
|
|
59
59
|
| tj/co | 19 | 12,996 | 9,189 | 0.71 | 74,613 |
|
|
60
|
-
| isaacs/minimatch |
|
|
61
|
-
| moment/luxon | 151 | 303,
|
|
60
|
+
| isaacs/minimatch | 87 | 303,508 | 64,794,947 | 213.49 | 1,764,476 |
|
|
61
|
+
| moment/luxon | 151 | 303,029 | 250,093 | 0.83 | 806,740 |
|
|
62
62
|
| psf/requests | 117 | 382,695 | 687,333 | 1.80 | 524,712 |
|
|
63
63
|
| pallets/click | 177 | 470,265 | 335,153 | 0.71 | 1,413,342 |
|
|
64
|
-
| expressjs/express | 215 | 261,
|
|
65
|
-
| colinhacks/zod |
|
|
66
|
-
| anuraghazra/github-readme-stats | 131 | 205,
|
|
64
|
+
| expressjs/express | 215 | 261,817 | 198,639 | 0.76 | 792,177 |
|
|
65
|
+
| colinhacks/zod | 687 | 1,768,759 | 1,752,965 | 0.99 | 4,485,971 |
|
|
66
|
+
| anuraghazra/github-readme-stats | 131 | 205,013 | 169,079 | 0.82 | 553,367 |
|
|
67
67
|
|
|
68
68
|
Read it carefully:
|
|
69
69
|
|
|
@@ -73,7 +73,7 @@ Read it carefully:
|
|
|
73
73
|
reasonable estimates of the same text do.
|
|
74
74
|
- **minimatch is the exception, and it is a policy difference, not an estimate.** That repository
|
|
75
75
|
carries five benchmark fixtures of 20 to 25 MB of JSON. repomix emits them (64.8M tokens); our
|
|
76
|
-
large-file rule emits a bounded preview and records the omission, so the pack stays
|
|
76
|
+
large-file rule emits a bounded preview and records the omission, so the pack stays 303,508 tokens.
|
|
77
77
|
A pack that will not fit in a context window has not helped the reader, however complete it is.
|
|
78
78
|
- **gitingest publishes no token count**, so its column is the size of its one-document digest.
|
|
79
79
|
- **File counts agree within one or two** everywhere except minimatch, where our preview keeps the
|
|
@@ -98,32 +98,32 @@ node scripts/compare.mjs --repomix # add --json for machine-readable output
|
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
repomix is fetched through `npx` at run time and gitingest through `python -m gitingest`;
|
|
101
|
-
neither is a dependency of this package. Measured on this repository at 0.
|
|
102
|
-
gitingest from PyPI, same machine:
|
|
101
|
+
neither is a dependency of this package. Measured on this repository at **0.21.0 on 2026-11-30**,
|
|
102
|
+
repomix 1.19.0, gitingest from PyPI, same machine:
|
|
103
103
|
|
|
104
104
|
| Tool / mode | Files | Content bytes | Tokens | vs full | Time |
|
|
105
105
|
| :-- | --: | --: | --: | --: | --: |
|
|
106
|
-
| codebase-snapshot (full) |
|
|
107
|
-
| codebase-snapshot (slice) |
|
|
108
|
-
| codebase-snapshot (budget 30,000) | 22 | 119,
|
|
109
|
-
| repomix 1.19.0 |
|
|
110
|
-
| gitingest | ? | 3,
|
|
106
|
+
| codebase-snapshot (full) | 221 | 2,549,431 | 764,225 | 100% | 2.04 s |
|
|
107
|
+
| codebase-snapshot (slice) | 7 | 231,622 | 63,983 | 8.4% | 1.63 s |
|
|
108
|
+
| codebase-snapshot (budget 30,000) | 22 | 119,794 | 36,005 | 4.7% | 1.70 s |
|
|
109
|
+
| repomix 1.19.0 | 386 | 4,245,226 | 1,067,915 | 139.7% | n/a |
|
|
110
|
+
| gitingest | ? | 3,848,714 | n/a | n/a | n/a |
|
|
111
111
|
|
|
112
112
|
Read that honestly:
|
|
113
113
|
|
|
114
|
-
- **
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
114
|
+
- **The comparison is not a purity test.** repomix packed 386 files and 4.25 MB; our full run packed
|
|
115
|
+
221 files and 2.55 MB. The file sets differ because the ignore rules differ, so the token totals
|
|
116
|
+
describe two different packs.
|
|
117
|
+
- **Each tool counts tokens its own way.** Our manifest counts word runs, punctuation and newlines
|
|
118
|
+
(the budget planner uses bytes/4); repomix uses a tokenizer. Neither is the model's exact count;
|
|
119
|
+
read the share, not the absolute number.
|
|
120
|
+
- **Our pack is smaller in bytes** (2.55 MB of file content against repomix's 4.25 MB of output,
|
|
121
|
+
which includes its own wrappers), and gitingest's digest is larger still at 3.85 MB.
|
|
121
122
|
- **The modes are what the other tool does not have.** repomix packs the repository; a slice and a
|
|
122
|
-
budget are the same snapshot narrowed after scanning, at
|
|
123
|
-
- **gitingest
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
only honest one.
|
|
123
|
+
budget are the same snapshot narrowed after scanning, at 8.4% and 4.7% of our full tokens.
|
|
124
|
+
- **gitingest publishes no token count at all.** The harness reports its digest size and says so.
|
|
125
|
+
Its output is one flat document with a tree and a separator per file, which is why a byte
|
|
126
|
+
comparison is the only honest one.
|
|
127
127
|
|
|
128
128
|
The same caveats apply to any comparison: different ignore rules, different wrappers, different
|
|
129
129
|
tokenizers. What is comparable is the shape — full packs are too large for a context window, and a
|
package/docs/brief.md
CHANGED
|
@@ -1,109 +1,108 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Briefs
|
|
2
2
|
|
|
3
|
-
`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
recognise. That is judgement, so it is supplied as a file and merged into the brief.
|
|
3
|
+
`codebase-snapshot brief` packs one reviewer-ready Markdown document: a question or a change, the
|
|
4
|
+
impact it reaches, the candidate tests, and bounded redacted source windows. It is the formatting
|
|
5
|
+
layer over `impact` and `context`; it does not invent a second graph.
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
# init writes BRIEF.md next to the config, with the five headings and guidance in comments
|
|
10
|
-
npx codebase-snapshot init --yes
|
|
7
|
+
## Run it
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
```bash
|
|
10
|
+
codebase-snapshot brief "how does authentication work?"
|
|
11
|
+
codebase-snapshot brief --diff origin/main
|
|
12
|
+
codebase-snapshot brief --paths src/router.ts --out notes/review.md
|
|
13
|
+
codebase-snapshot brief --diff HEAD --copy
|
|
14
|
+
codebase-snapshot brief --diff HEAD --format json
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
brief: "BRIEF.md", // relative to the project root; a missing file is an error
|
|
20
|
-
promptTask: "audit", // audit | review | explain
|
|
21
|
-
};
|
|
22
|
-
```
|
|
17
|
+
With neither a question nor `--diff`/`--paths`, the change is the working tree against `HEAD`.
|
|
18
|
+
The brief uses the live index by default and writes nothing into the repository; `--no-live`
|
|
19
|
+
requires the persisted snapshot.
|
|
23
20
|
|
|
24
|
-
##
|
|
21
|
+
## What it contains
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
1. A trust stamp: index source, freshness, coverage, redaction count, omitted count, and any named
|
|
24
|
+
partial reason.
|
|
25
|
+
2. The question or impact summary.
|
|
26
|
+
3. For a change: changed files, symbol-pruned affected files, routes, candidate tests and warnings.
|
|
27
|
+
4. For a diff: the diff hunks, passed through the same span-masking redaction as every other artifact.
|
|
28
|
+
No raw credential excerpt is copied into the brief.
|
|
29
|
+
5. Bounded source windows for the files that matter, until `--max-tokens` is reached.
|
|
30
|
+
6. A named list of files that did not fit or are unavailable. Nothing is dropped silently.
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
`--format pr-comment` renders the affected-file list and details as a collapsible GitHub comment.
|
|
33
|
+
`--out` writes inside the repository only; a path that escapes through `..` or a link is refused.
|
|
34
|
+
`--copy` uses the platform clipboard command (`clip`, `pbcopy`, `wl-copy` or `xclip`) with
|
|
35
|
+
`shell: false`.
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
an assertion from a measurement.
|
|
37
|
+
## Options
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
| Option | Meaning |
|
|
40
|
+
| :-- | :-- |
|
|
41
|
+
| `--diff <ref>` | Compare the working tree with a git ref. |
|
|
42
|
+
| `--paths <a,b>` | Treat repository-relative paths as the change. |
|
|
43
|
+
| `--max-tokens <n>` | Token budget for the assembled brief (default 12000, minimum 500). |
|
|
44
|
+
| `--lines-per-file <n>` | Line window per file (default 80). |
|
|
45
|
+
| `--include-tests` | Include candidate tests, not only production impact. |
|
|
46
|
+
| `--copy` | Copy the finished brief to the clipboard. |
|
|
47
|
+
| `--out <path>` | Write the brief to a repository-relative path. |
|
|
48
|
+
| `--format json` | Return `{ markdown, usedTokens, files, omitted, trust }` and keep stdout parseable. |
|
|
49
|
+
| `--format pr-comment` | Render collapsible PR-comment sections. |
|
|
50
|
+
| `--no-cache` | Bypass the OS live-index summary cache. |
|
|
51
|
+
| `--no-live` | Require the generated snapshot. |
|
|
42
52
|
|
|
43
|
-
|
|
44
|
-
<!-- BRIEF.md: fill in what you know; an empty section is simply not rendered -->
|
|
53
|
+
## When a brief is the right tool
|
|
45
54
|
|
|
46
|
-
|
|
55
|
+
- **A pull request needs one review artefact.** The brief puts the change, its affected files, the
|
|
56
|
+
candidate tests and bounded source windows in one Markdown document a reviewer can paste into a
|
|
57
|
+
comment or a model.
|
|
58
|
+
- **The reviewer is not the author.** A trust stamp and an explicit omission list let someone who
|
|
59
|
+
did not write the code judge whether the context is complete.
|
|
60
|
+
- **You need a redacted diff.** The diff is masked with the same span rules as every other artifact;
|
|
61
|
+
a credential in the hunk does not reach the brief.
|
|
47
62
|
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
Use a snapshot instead when the task is "explain this repository"; use impact when the task is
|
|
64
|
+
"tell me what this change reaches" and you do not need prose.
|
|
50
65
|
|
|
51
|
-
## What
|
|
66
|
+
## What a review looks like
|
|
52
67
|
|
|
53
|
-
|
|
54
|
-
flag that means only that the call returned.
|
|
68
|
+
codebase-snapshot brief --diff origin/main --format pr-comment
|
|
55
69
|
|
|
56
|
-
|
|
70
|
+
```text
|
|
71
|
+
# Change brief
|
|
57
72
|
|
|
58
|
-
-
|
|
59
|
-
- a recipe that never worked, because its test supplied a number where the daemon sends a string
|
|
60
|
-
```
|
|
73
|
+
Trust: source=live-overlay · freshness=live-computed · coverage=complete · redacted=0 · omitted=0
|
|
61
74
|
|
|
62
|
-
|
|
75
|
+
**Changed:** 3 · **Affected:** 7 · **Tests:** 2
|
|
63
76
|
|
|
64
|
-
|
|
77
|
+
<details><summary>Affected files</summary>
|
|
78
|
+
...
|
|
79
|
+
</details>
|
|
65
80
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- **a file that cannot be read.** A snapshot must not quietly ship without the half you wrote.
|
|
70
|
-
- **an edited brief after generating.** Its digest is recorded, so `validate` reports
|
|
71
|
-
`brief: docs/brief.md changed since this snapshot was generated`.
|
|
72
|
-
|
|
73
|
-
A brief must also stay inside the repository and must not be a credential-bearing file; a path
|
|
74
|
-
that escapes the repository is refused, because an untrusted `snapshot.config.json` must not turn
|
|
75
|
-
the brief into a host-file read. Its prose is redacted with the full content scanner, so a PEM
|
|
76
|
-
private key pasted into the text is masked as a block.
|
|
77
|
-
|
|
78
|
-
Two smaller ones: a heading defined twice is ambiguous and refused, and a file over 64 KiB is
|
|
79
|
-
refused with its size — past that it is a second codebase rather than instruction.
|
|
81
|
+
### `src/auth/session.ts` — changed
|
|
82
|
+
...
|
|
83
|
+
```
|
|
80
84
|
|
|
81
|
-
|
|
85
|
+
The exact headings depend on the format. In every format the same three facts are present: what
|
|
86
|
+
changed, what the tool believes it reaches, and what it could not include.
|
|
82
87
|
|
|
83
|
-
|
|
84
|
-
| :--- | :--- |
|
|
85
|
-
| `## stakes`, `## STAKES` | the stakes section; headings match case-insensitively |
|
|
86
|
-
| `## Stakes:` | the stakes section; a trailing colon is a typo, not a different heading |
|
|
87
|
-
| `<!-- ... -->` | removed before parsing — the `init` scaffold is all comments and renders nothing |
|
|
88
|
-
| a section with no text | not rendered at all |
|
|
89
|
-
| a fenced block containing `## Coverage` | content, not a heading |
|
|
90
|
-
| CRLF, or a UTF-8 byte-order mark | read like the plain case |
|
|
91
|
-
| a control character | escaped, as everywhere else this tool reproduces text |
|
|
88
|
+
## What it does not do
|
|
92
89
|
|
|
93
|
-
|
|
90
|
+
- It does not run the tests it names; it selects candidates.
|
|
91
|
+
- It does not prove runtime reachability; the impact report is a static, conservative analysis.
|
|
92
|
+
- It does not silently fill a budget with unrelated files. A file that does not fit is named in the
|
|
93
|
+
omission list.
|
|
94
|
+
- It does not edit the repository unless --out names a path; that write is confined to the repository.
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
## Why it exists
|
|
96
97
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
A review starts with a diff, but the diff is not the change: the call sites, the route and the test
|
|
99
|
+
that will fail are elsewhere. The brief puts those on one page, marks what is evidence and what is a
|
|
100
|
+
candidate, and stamps the trust envelope so a reader can tell a complete answer from a partial one.
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
is a usage error, never a silent fall back to the default.
|
|
102
|
+
→ [Impact reports](impact.md) · [CLI reference](cli.md) · [MCP tools](tools.md)
|
|
103
103
|
|
|
104
|
-
##
|
|
104
|
+
## Related
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
ordinary file in the repository — it may be snapshotted, or excluded with `excludePatterns`.
|
|
106
|
+
- [Impact reports](impact.md) — the analysis a brief is built from.
|
|
107
|
+
- [MCP server for a codebase](mcp-server-for-codebase.md) — the same tools over MCP.
|
|
108
|
+
- [LLM codebase context](llm-codebase-context.md) — the broader guide.
|
package/docs/cli.md
CHANGED
|
@@ -57,7 +57,11 @@ as it makes it.
|
|
|
57
57
|
- [Commands](#commands)
|
|
58
58
|
- [`generate`](#generate)
|
|
59
59
|
- [`validate` / `check`](#validate--check)
|
|
60
|
+
- [`serve`](#serve)
|
|
61
|
+
- [`health`](#health)
|
|
60
62
|
- [`report`](#report)
|
|
63
|
+
- [`impact`](#impact)
|
|
64
|
+
- [`brief`](#brief)
|
|
61
65
|
- [`setup`](#setup)
|
|
62
66
|
- [`init`](#init)
|
|
63
67
|
- [`explain <path>`](#explain-path)
|
|
@@ -65,6 +69,7 @@ as it makes it.
|
|
|
65
69
|
- [`describe`](#describe)
|
|
66
70
|
- [`update`](#update)
|
|
67
71
|
- [`skill`](#skill)
|
|
72
|
+
- [`mcp`](#mcp)
|
|
68
73
|
- [Options](#options)
|
|
69
74
|
- [Exit codes](#exit-codes)
|
|
70
75
|
- [Output streams](#output-streams)
|
|
@@ -98,7 +103,7 @@ Exit `0` when the snapshot passes its own integrity check, `1` when it does not.
|
|
|
98
103
|
|
|
99
104
|
```
|
|
100
105
|
📸 Generating snapshot for: /path/to/repo
|
|
101
|
-
Branch: main (fallback) | Part budget: 300 KB | Generator: 0.
|
|
106
|
+
Branch: main (fallback) | Part budget: 300 KB | Generator: 0.21.0 (project dependency ^0.21.0)
|
|
102
107
|
|
|
103
108
|
✅ Snapshot generated in 0.14s:
|
|
104
109
|
- Tracked files: 121 included of 128 paths found — 7 skipped (default-ignore 5, binary 1, sensitive-file 1); every one is listed in snapshot/reports/audit.md
|
|
@@ -199,6 +204,56 @@ It takes `--cwd`, `--out-dir`, `--no-config`, `--format` and `--no-update-check`
|
|
|
199
204
|
generation settings are rejected, not ignored: `report --max-part-bytes 120k` exits `2` with a
|
|
200
205
|
message naming the commands that do accept it.
|
|
201
206
|
|
|
207
|
+
### `impact`
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
codebase-snapshot impact --diff main
|
|
211
|
+
codebase-snapshot impact --paths src/lib/jwt.ts,src/routes/login.ts --format json
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Builds a live index from `manifest.json` when one is current, overlays changed and new files in
|
|
215
|
+
memory when the working tree has moved, or scans the confined working tree when no snapshot exists.
|
|
216
|
+
It resolves the change through the same import resolver the generator used and reports the
|
|
217
|
+
reverse-import closure (what imports the changed files, then what imports those) plus the tests that
|
|
218
|
+
directly import a changed or affected file. Test files are kept out of `affected[]` and listed in
|
|
219
|
+
`tests[]`, so the production blast radius is not inflated by every test that imports a barrel. It
|
|
220
|
+
never writes into the repository.
|
|
221
|
+
|
|
222
|
+
Use exactly one source for the change:
|
|
223
|
+
|
|
224
|
+
- `--diff <ref>` compares the working tree with that git ref, including staged, unstaged and
|
|
225
|
+
untracked changes. A ref beginning with `-` is refused.
|
|
226
|
+
- `--paths <a,b>` treats the named repository-relative paths as the change. Absolute paths and
|
|
227
|
+
`..` segments are refused.
|
|
228
|
+
|
|
229
|
+
The report separates what it knows: `changed[]` says whether each path is in the snapshot,
|
|
230
|
+
`affected[]` carries the distance and the exact import specifier for every hop, `tests[]` lists
|
|
231
|
+
candidate tests (never coverage), `unresolved[]` names repository-internal imports that did not
|
|
232
|
+
resolve (bare packages and Node built-ins are not counted), and
|
|
233
|
+
`warnings[]` says when the snapshot is dirty or the result was truncated. `--depth` (default 3,
|
|
234
|
+
max 8) bounds the reverse walk; `--max-results` (default 200, max 1000) bounds `affected[]`.
|
|
235
|
+
|
|
236
|
+
Exit `0` when the report was produced, `1` when the live index cannot be built or an existing
|
|
237
|
+
manifest is unreadable, and `2` for a usage error. `--format json` writes the stable report object to stdout; text mode writes the
|
|
238
|
+
human report to stderr, like every other human-facing command.
|
|
239
|
+
|
|
240
|
+
→ [Impact reports](impact.md): the field contract, resolution rules and what the report does not claim.
|
|
241
|
+
|
|
242
|
+
### `brief`
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
codebase-snapshot brief "how does authentication work?"
|
|
246
|
+
codebase-snapshot brief --diff main --copy
|
|
247
|
+
codebase-snapshot brief --paths src/router.ts --out notes/review.md --format pr-comment
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Pack one redacted, bounded Markdown brief for a reviewer or a model. With a question it uses the
|
|
251
|
+
planner; with `--diff` or `--paths` it uses the impact report. The diff hunks pass through the
|
|
252
|
+
same redaction as every artifact, the trust envelope is stamped at the top, and every file that did
|
|
253
|
+
not fit is named rather than dropped. `--copy` copies the result, `--out` writes it inside the
|
|
254
|
+
repository, and `--format json` returns `{ markdown, usedTokens, files, omitted }` without
|
|
255
|
+
printing the Markdown first.
|
|
256
|
+
|
|
202
257
|
### `setup`
|
|
203
258
|
|
|
204
259
|
```bash
|
|
@@ -224,7 +279,7 @@ The whole first run in one command, with defaults and no prompts. This is the sa
|
|
|
224
279
|
🚀 Setup for: /path/to/repo
|
|
225
280
|
✅ Created snapshot.config.json (preset: nextjs)
|
|
226
281
|
Added npm scripts: snapshot, snapshot:validate
|
|
227
|
-
Added devDependency: codebase-snapshot ^0.
|
|
282
|
+
Added devDependency: codebase-snapshot ^0.21.0
|
|
228
283
|
Added to .gitignore: /snapshot/, /snapshot.tmp/
|
|
229
284
|
⏳ Installing dependencies…
|
|
230
285
|
✅ Installed dependencies (npm install, 2.1s)
|
|
@@ -276,7 +331,7 @@ It also has three side effects on files you own, and it says so when it does the
|
|
|
276
331
|
```
|
|
277
332
|
✅ Created snapshot.config.json (preset: node-lib)
|
|
278
333
|
Added npm scripts: snapshot, snapshot:validate
|
|
279
|
-
Added devDependency: codebase-snapshot ^0.
|
|
334
|
+
Added devDependency: codebase-snapshot ^0.21.0
|
|
280
335
|
Added to .gitignore: /snapshot/, /snapshot.tmp/
|
|
281
336
|
```
|
|
282
337
|
|
|
@@ -426,12 +481,12 @@ agent](agent.md).
|
|
|
426
481
|
Ask the npm registry whether a newer release exists, and print the version it compared against:
|
|
427
482
|
|
|
428
483
|
```bash
|
|
429
|
-
npx codebase-snapshot@0.
|
|
430
|
-
npx codebase-snapshot@0.
|
|
484
|
+
npx codebase-snapshot@0.21.0 update # is this build current? print the answer
|
|
485
|
+
npx codebase-snapshot@0.21.0 update --format json
|
|
431
486
|
```
|
|
432
487
|
|
|
433
488
|
```text
|
|
434
|
-
You are on codebase-snapshot 0.20.
|
|
489
|
+
You are on codebase-snapshot 0.20.13, and the registry publishes 0.20.13. No update is available.
|
|
435
490
|
```
|
|
436
491
|
|
|
437
492
|
Exit `0` when the installed version is current, `1` when a newer release exists, `2` when the
|
|
@@ -447,14 +502,17 @@ finds a release, an hour when it finds none, and five minutes after a failed req
|
|
|
447
502
|
|
|
448
503
|
```bash
|
|
449
504
|
codebase-snapshot skill # print on stdout
|
|
450
|
-
codebase-snapshot skill --install # write
|
|
505
|
+
codebase-snapshot skill --install # write all three registries
|
|
451
506
|
codebase-snapshot skill --install --target claude
|
|
507
|
+
codebase-snapshot skill --install --with-mcp
|
|
452
508
|
```
|
|
453
509
|
|
|
454
510
|
Prints or installs the bundled agent skill. Installation writes
|
|
455
|
-
`.
|
|
456
|
-
|
|
457
|
-
skill name**, so the file cannot be mistaken for your own documentation.
|
|
511
|
+
`.agents/skills/codebase-snapshot/SKILL.md`, `.claude/skills/codebase-snapshot/SKILL.md` and
|
|
512
|
+
`.cursor/rules/codebase-snapshot.mdc`; `--target` limits it to one registry. All three are
|
|
513
|
+
**registries keyed by skill name**, so the file cannot be mistaken for your own documentation.
|
|
514
|
+
`--with-mcp` merges one `codebase-snapshot` entry into `.mcp.json` without removing other servers
|
|
515
|
+
and keeps an existing different entry, with a note.
|
|
458
516
|
|
|
459
517
|
It does not write `AGENTS.md`. That file is your project's agent contract — build commands,
|
|
460
518
|
conventions, house rules — and a tool has no business editing it. If you want the skill
|
|
@@ -478,8 +536,8 @@ codebase-snapshot mcp # serve the current directory over stdio
|
|
|
478
536
|
codebase-snapshot mcp --cwd <path> # serve another repository
|
|
479
537
|
```
|
|
480
538
|
|
|
481
|
-
Serves the repository to a Model Context Protocol client over stdio:
|
|
482
|
-
resources and seven prompts. Stdout carries JSON-RPC messages and nothing else; every note goes to
|
|
539
|
+
Serves the repository to a Model Context Protocol client over stdio: 7 tools, `snapshot://`
|
|
540
|
+
resources and seven prompts, with live reads by default. Stdout carries JSON-RPC messages and nothing else; every note goes to
|
|
483
541
|
stderr. It speaks both protocol eras — the legacy `initialize` handshake and the stateless
|
|
484
542
|
`2026-07-28` revision — and answers whichever the client starts with. With `--http`, modern
|
|
485
543
|
requests carry `MCP-Protocol-Version`, `Mcp-Method` and (for named calls) `Mcp-Name`;
|
|
@@ -500,8 +558,8 @@ for the two install flags, and the init-and-setup flags list both commands.
|
|
|
500
558
|
|
|
501
559
|
| Option | Type | Default | Applies to | Meaning |
|
|
502
560
|
| :--- | :--- | :--- | :--- | :--- |
|
|
503
|
-
| `--cwd <path>` | path | current directory | generate, validate, report, explain, init, setup, skill, mcp | Repository to operate on. Must exist and be a directory. `diff` and `describe` take no `--cwd`; for `mcp` it chooses the one repository the server serves. |
|
|
504
|
-
| `--out-dir <path>` | path | `snapshot` | generate, validate, report, explain, init, setup | Where the snapshot is written or read. May be absolute. |
|
|
561
|
+
| `--cwd <path>` | path | current directory | generate, validate, report, impact, brief, explain, init, setup, skill, mcp, health, serve | Repository to operate on. Must exist and be a directory. `diff` and `describe` take no `--cwd`; for `mcp` it chooses the one repository the server serves. |
|
|
562
|
+
| `--out-dir <path>` | path | `snapshot` | generate, validate, report, impact, brief, explain, init, setup, health | Where the snapshot is written or read. May be absolute. |
|
|
505
563
|
| `--max-part-bytes <n>` | size | `307200` (300 KB) | generate, validate, init, setup | Hard ceiling per markdown part. Accepts `120k`, `1.5mb`. Minimum 4096. |
|
|
506
564
|
| `--max-part-tokens <n>` | size | unset | generate, validate, setup | A per-part ceiling in **tokens**, for a context window rather than a disk. Narrows `--max-part-bytes` to the equivalent byte count (`tokens × 4`); the smaller of the two ceilings always wins, and both are recorded in the manifest. Accepts `32k`. Minimum 1024 — below that it is a usage error, not a value quietly raised to the floor. The byte ceiling is what is enforced: `estimatedTokens` is an estimate, and a part whose estimate exceeds the token ceiling is named in a warning rather than silently accepted. |
|
|
507
565
|
| `--large-file-bytes <n>` | size | the part budget (307200) | generate, validate, explain, setup | Above this, a file becomes a head/tail preview. It may not exceed `--max-part-bytes`: a file between the two could not fit a part. |
|
|
@@ -509,7 +567,7 @@ for the two install flags, and the init-and-setup flags list both commands.
|
|
|
509
567
|
| `--brief <path>` | path | unset | generate, validate | The owner-written half of `PROMPT.md`: `Stakes`, `The system`, `What came before`, `The bar`, `Calibration`. Unknown headings are kept as Owner notes; measured headings cannot be redefined; the file is digested, so editing it is drift. |
|
|
510
568
|
| `--remote <url>` | url | unset | generate | Fetch a repository instead of scanning the current directory. https only, public addresses only, shallow clone; the manifest records the URL and the commit. See [remote](remote.md). |
|
|
511
569
|
| `--ref <branch>` | string | unset | generate | With `--remote`: the branch or tag to clone. |
|
|
512
|
-
| `--allow-private` | flag | off | generate | With `--remote`: allow private addresses and `file:` URLs. Refused by default. |
|
|
570
|
+
| `--allow-private` | flag | off | generate, serve | With `--remote`: allow private addresses and `file:` URLs. Refused by default. |
|
|
513
571
|
| `--keep-clone` | flag | off | generate | With `--remote`: keep the temporary clone and print where it is. |
|
|
514
572
|
| `--http` | flag | off | mcp | Serve MCP over HTTP (Streamable HTTP: POST a JSON-RPC message to `/mcp`) instead of stdio. Loopback by default; a bearer token is generated and printed unless `--token` or `--no-auth` is given. Health endpoint: `GET /healthz`. |
|
|
515
573
|
| `--port <n>` | string | `4789` | mcp, serve | `mcp --http`: port to bind. `0` picks an ephemeral port and prints it. |
|
|
@@ -520,7 +578,7 @@ for the two install flags, and the init-and-setup flags list both commands.
|
|
|
520
578
|
| `--all-members` | flag | off | health | Audit every snapshot a `--workspace` run wrote, not only the one at `outDir`. The combined score is the weakest member. |
|
|
521
579
|
| `--deep` | flag | off | health | Replay every full body from the source bytes on disk and compare it with the part. The only allowed difference is a redaction marker. Off by default because it re-reads the repository. |
|
|
522
580
|
| `--strict` | flag | off | health | `health` only: exit 2 when a critical check fails, and 1 when a warning is the only thing left. Without it a critical check exits 1 and warnings exit 0. |
|
|
523
|
-
| `--mode <command>` | string | unset | generate, validate, report, explain, init, setup, diff, describe, skill | Select the command when no command word is given. A command word and `--mode` must name the same command; a contradiction is a usage error (exit 2). |
|
|
581
|
+
| `--mode <command>` | string | unset | generate, validate, report, impact, brief, explain, init, setup, diff, describe, skill, mcp, health, update, serve | Select the command when no command word is given. A command word and `--mode` must name the same command; a contradiction is a usage error (exit 2). |
|
|
524
582
|
| `--no-update-check` | flag | off | all commands except `update` | Skip the check for a newer published version. Already skipped when stdout is not a terminal, in CI, in a JSON invocation, and in `mcp`, which makes no network requests. `update` exists to contact the registry, so it has no check to skip. |
|
|
525
583
|
| `--prompt-task <task>` | string | `audit` | generate, validate | `audit`, `review` or `explain` — which job the brief is written for. Changes the opening section, not the standard. |
|
|
526
584
|
| `--budget-tokens <n>` | count | unset | generate | Fit the snapshot into n tokens by selecting whole files (entry points, then the most-imported). Records a `budget` block; the rest are `not-selected`. See [budget](budget.md). |
|
|
@@ -534,19 +592,36 @@ for the two install flags, and the init-and-setup flags list both commands.
|
|
|
534
592
|
| `--slice <question>` | string | unset | generate | Narrow the snapshot to what the retrieval planner picks for this question. Records a `slice` block and `skipped[]` reasons `not-selected`. See [slices](slice.md). |
|
|
535
593
|
| `--slice-tokens <n>` | count | `30000` | generate | The token budget for `--slice`. |
|
|
536
594
|
| `--delta <path>` | path | unset | generate | Narrow the snapshot to what changed since a base snapshot, plus the one-hop importers. Unchanged files are recorded in `delta.unchanged` and `skipped[]`. See [delta](delta.md). |
|
|
537
|
-
| `--include-diffs` | flag | off | generate | Also write `reports/diff.md`: the unstaged and staged diff, with the commands, bounded to 200 KiB. Absent when the tree is clean; outside a git repository the run warns and writes nothing. |
|
|
538
|
-
| `--include-logs <n>` | count | unset | generate | Also write `reports/log.md`: the last n commits (1–500), one line each; outside a git repository the run warns and writes nothing. |
|
|
539
|
-
| `--token-tree` | flag | off | generate | Also write `reports/tokens.md`: per-file token estimates sorted by cost, with directory rollups. |
|
|
595
|
+
| `--include-diffs` | flag | off | generate, validate | Also write `reports/diff.md`: the unstaged and staged diff, with the commands, bounded to 200 KiB. Absent when the tree is clean; outside a git repository the run warns and writes nothing. |
|
|
596
|
+
| `--include-logs <n>` | count | unset | generate, validate | Also write `reports/log.md`: the last n commits (1–500), one line each; outside a git repository the run warns and writes nothing. |
|
|
597
|
+
| `--token-tree` | flag | off | generate, validate | Also write `reports/tokens.md`: per-file token estimates sorted by cost, with directory rollups. |
|
|
540
598
|
| `--max-parts <n>` | count | unset | generate, validate | **Experimental.** Grow the per-part budget until the snapshot has at most `n` parts, so the file count stays fixed as the code grows. The budget it settles on is recorded in `manifest.budgets.maxPartBytes` and may exceed `--max-part-bytes`; a warning says so. `0` is a usage error. |
|
|
541
599
|
| `--attachment-slots <n>` | count | `10` | generate | Files the destination accepts in one message; `0` means no limit. `PROMPT.md` plans the delivery against it — which parts to attach, what to leave behind, and the `--max-part-bytes` value that would merge them. It changes no part and no file, so it is recorded in the manifest but is not part of the config digest. |
|
|
542
600
|
| `--include-monolith` | flag | off | generate, validate, setup | Also write `full-codebase.json` and `full-codebase.md`. |
|
|
543
601
|
| `--include-sensitive-files` | flag | off | generate, validate, explain, init, setup | Emit `.env`, `*.pem`, `.npmrc` and similar. Off by default; they are reported as skipped. |
|
|
544
602
|
| `--skip-artifacts <names>` | list | unset | generate, validate, init, setup | Comma-separated artifacts to omit. |
|
|
545
603
|
| `--only-artifacts <names>` | list | unset | generate, validate, init, setup | Write *only* these, and **turn on** any this names: a config with `artifacts: { audit: false }` still gets `reports/audit.md` from `--only-artifacts audit`, because "only these" is a statement about the whole selection rather than a suppression list. Cannot be combined with `--skip-artifacts`. |
|
|
546
|
-
| `--format <text\|json>` | enum | `text` | generate, validate, report, explain, init, setup, diff, describe, skill | `json` writes a pure JSON payload to stdout. Every command except `mcp` honours
|
|
604
|
+
| `--format <text\|json\|markdown\|pr-comment>` | enum | `text` | generate, validate, report, impact, brief, explain, init, setup, diff, describe, skill, health, update | `json` writes a pure JSON payload to stdout. `impact` and `brief` also accept `markdown`; `pr-comment` renders the same brief with collapsible sections. Every command except `mcp` and `serve` honours `--format` — stdout there is the JSON-RPC protocol stream. |
|
|
547
605
|
| `--sarif` | flag | off | generate, validate, setup | Also write `reports/audit.sarif`: the redaction findings as SARIF 2.1.0, for upload to GitHub Code Scanning. The artefact carries the path, the line and the rule — never the value. Works with `--skip-artifacts audit`, because a CI gate does not read markdown. Rule ids are fixed per rule name, so adding a custom rule never re-points an existing alert. |
|
|
548
606
|
| `--skeleton` | flag | off | generate, validate, setup | Emit signatures instead of bodies: each function or method body becomes `{ /* ... */ }` in place, so formatting and comments around it are untouched. Covers `.ts`, `.tsx`, `.mts`, `.cts`, `.js`, `.jsx`, `.mjs` and `.cjs`; `.d.ts` files are left alone because they are already declarations. The summary still describes the whole file, and affected entries carry `inclusionMode: "signatures"`. `--include-monolith` still writes the whole body, so the monolith's `inclusionMode: "full"` stays true. |
|
|
549
607
|
| `--changed-since <ref>` | git ref | unset | generate, validate, explain | Include only files changed since this ref, plus untracked ones. Every other file is recorded in `manifest.skipped[]` with reason `unchanged` and is never opened. `validate` re-resolves the scope: a skipped file that has changed since is reported as drift, and one that has not is left alone — and with `--with-dependents`, so is a file that now imports one that changed. `explain` answers with the same rule. A ref beginning with `-` is refused. |
|
|
608
|
+
| `--diff <ref>` | git ref | unset | impact, brief | Compare the working tree against this ref for the impact report or change brief. Includes committed, staged, unstaged and untracked changes relative to it. Mutually exclusive with `--paths`; a ref beginning with `-` is refused. |
|
|
609
|
+
| `--paths <a,b>` | list | unset | impact, brief | Comma-separated repository-relative paths to treat as the change. Absolute paths and `..` segments are refused. Mutually exclusive with `--diff`. |
|
|
610
|
+
| `--depth <n>` | count | `3` | impact, brief | Reverse-import hops to follow for the impact report or change brief. Minimum 1, maximum 8. |
|
|
611
|
+
| `--max-results <n>` | count | `200` | impact, brief | Maximum files in `affected[]`. Minimum 1, maximum 1000; a hit sets `truncated` and adds a warning. |
|
|
612
|
+
| `--no-cache` | flag | off | impact, brief | Bypass the optional OS live-index summary cache. No cache file is written, and nothing is ever written inside the repository. |
|
|
613
|
+
| `--no-live` | flag | off | impact, brief | Require the generated snapshot instead of building or overlaying the live index. |
|
|
614
|
+
| `--tests-paths` | flag | off | impact | Print candidate test paths, one per line, instead of the report. |
|
|
615
|
+
| `--run` | flag | off | impact | Run the repository's own Vitest, Jest or `node --test` entry against the candidate tests. Uses `shell: false`; a build or test configuration change adds a full-suite warning. |
|
|
616
|
+
| `--precise` | flag | off | impact | Add compiler-resolved symbol references to the report. Requires the live index. |
|
|
617
|
+
| `--include-imports` | flag | off | impact | Add outgoing dependencies of every changed file. |
|
|
618
|
+
| `--include-cycles` | flag | off | impact | Add import cycles in the impacted subgraph. |
|
|
619
|
+
| `--copy` | flag | off | brief | Copy the finished brief to the platform clipboard. |
|
|
620
|
+
| `--out <path>` | path | unset | brief | Write the brief to this repository-relative path. A path that resolves outside the repository is refused. |
|
|
621
|
+
| `--max-tokens <n>` | count | `12000` | brief | Token budget for the assembled brief. |
|
|
622
|
+
| `--lines-per-file <n>` | count | `80` | brief | Line window per file in the brief. |
|
|
623
|
+
| `--include-tests` | flag | off | brief | Include candidate test files. |
|
|
624
|
+
| `--with-mcp` | flag | off | skill | With `skill --install`, merge a `codebase-snapshot` server entry into `.mcp.json` without clobbering other servers. |
|
|
550
625
|
| `--staged` | flag | off | generate, validate, explain | Include only files staged for the next commit. The bytes are read from the **index**, not the working tree, so a file with staged changes plus later unstaged edits is snapshotted at what `git commit` will write; a staged deletion is recorded in `manifest.skipped[]` with reason `deleted`. |
|
|
551
626
|
| `--with-dependents` | flag | off | generate, validate, explain | With either of the two above, also include the files that import a changed one — a one-hop closure, not a transitive walk. Needs a scope; alone it is a usage error. |
|
|
552
627
|
| `--install-hook` | flag | off | init, setup | Write `.git/hooks/pre-commit` so a commit is refused while the snapshot is out of date. The hook checks the `outDir` the config names, so it works for a project that does not use `snapshot/`. An existing hook is never replaced; the note says what to add to it instead. |
|
|
@@ -554,7 +629,7 @@ for the two install flags, and the init-and-setup flags list both commands.
|
|
|
554
629
|
| `--watch` | flag | off | generate | Regenerate on every change until interrupted. Redaction and parsing are cached per file across runs in the same process, keyed on the content hash, so a one-file edit regenerates from that one file instead of from the whole repository. The cache is memory only and is dropped when the process exits. |
|
|
555
630
|
| `--autopilot` | flag | off | generate | Set the project up without asking — config, `.gitignore`, npm scripts, devDependency, install — then generate. Never overwrites an existing config; refuses an empty directory (exit `1`); contradicts `--no-config` (exit `2`). |
|
|
556
631
|
| `--no-install` | flag | off | setup, generate `--autopilot` | Skip the dependency install. Anywhere else it is a usage error, because it would change nothing. |
|
|
557
|
-
| `--no-config` | flag | off | generate, validate, report, explain, diff, mcp | Ignore every `snapshot.config.*` file and run on the built-in defaults. `diff` never loads a config anyway and accepts the flag for consistency; `mcp` uses it when a repository config cannot be read or should not be trusted. |
|
|
632
|
+
| `--no-config` | flag | off | generate, validate, report, impact, brief, explain, diff, mcp | Ignore every `snapshot.config.*` file and run on the built-in defaults. `diff` never loads a config anyway and accepts the flag for consistency; `mcp` uses it when a repository config cannot be read or should not be trusted. |
|
|
558
633
|
| `--discovery <mode>` | enum | `auto` | generate, validate, explain, setup | How files are found: `auto` lists through git when git works and refuses when a `.git` directory cannot be listed; `git` requires git; `walk` scans the tree and reads `.gitignore` files directly. The escape hatch for a broken `.git`. |
|
|
559
634
|
| `--preset <name>` | name | detected | init, setup | Force a preset instead of detecting one. |
|
|
560
635
|
| `--include <globs>` | list | unset | init, setup | Allow-list recorded in the generated config. |
|
|
@@ -562,7 +637,7 @@ for the two install flags, and the init-and-setup flags list both commands.
|
|
|
562
637
|
| `--yes` | flag | off | init, setup | Never prompt; accept every default. |
|
|
563
638
|
| `--force` | flag | off | init, setup | Replace an existing JSON-family config in place. An executable `.ts`/`.js`/`.mjs` config is refused, naming the file to remove. |
|
|
564
639
|
| `--install` | flag | off | *skill only* | Write the skill into the repository instead of printing it. |
|
|
565
|
-
| `--target <name>` | enum | `all` | *skill only* | `claude`, `cursor` or `all`. |
|
|
640
|
+
| `--target <name>` | enum | `all` | *skill only* | `agents`, `claude`, `cursor` or `all`. |
|
|
566
641
|
| `-h`, `--help` | flag | — | every command | Print usage. |
|
|
567
642
|
| `-v`, `--version` | flag | — | every command | Print the version on stdout: a bare `v`-prefixed semver (for example `v1.2.3`), with no package name. |
|
|
568
643
|
|
|
@@ -600,15 +675,15 @@ same run. With `--mode`, the remaining positionals are that command's arguments,
|
|
|
600
675
|
`--mode explain src/server.ts` and `--mode diff old-snapshot snapshot` work the same way the
|
|
601
676
|
positional form does.
|
|
602
677
|
|
|
603
|
-
It accepts the
|
|
678
|
+
It accepts the fifteen commands plus the `check` alias — the sixteen names the error lists — and it is
|
|
604
679
|
deliberately strict: asking for two different commands is an error rather than a silent winner.
|
|
605
680
|
|
|
606
681
|
```
|
|
607
682
|
❌ --mode validate contradicts the command "generate". Pass one or the other.
|
|
608
|
-
❌ Unknown --mode "bogus". Expected one of: generate, validate, check, report, init, setup, explain, diff, describe, skill, mcp.
|
|
683
|
+
❌ Unknown --mode "bogus". Expected one of: generate, validate, check, report, impact, brief, init, setup, explain, diff, describe, skill, mcp, health, update, serve.
|
|
609
684
|
```
|
|
610
685
|
|
|
611
|
-
`describe` does list `--mode` in its option table (`appliesTo` names
|
|
686
|
+
`describe` does list `--mode` in its option table (`appliesTo` names every command that accepts it),
|
|
612
687
|
but `--help` does not: the positional form is the documented one for people, and the flag exists
|
|
613
688
|
for wrappers and for the contract.
|
|
614
689
|
|