@compaction/cli 0.1.0 → 0.1.2

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 +142 -264
  2. package/dist/cli/index.js +24 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,319 +1,197 @@
1
1
  # @compaction/cli
2
2
 
3
- **The free, local-first CLI for capturing and measuring AI agent traces.** It
4
- captures supported agent sessions on your own machine, shows input/output tokens
5
- and estimated spend with honest labels, and writes local reports and redacted
6
- share bundlesand, **when you opt in**, prepares those traces for optimization
7
- and verification via the **Compaction API**.
8
-
9
- > **The local CLI captures, measures, and prepares.** Optimization, advanced
10
- > verification, apply guidance, and team reporting are **not** in the free CLI
11
- > they require the **Compaction API** (opt-in).
12
-
13
- ## What the free CLI does (local, no account, no upload by default)
14
-
15
- `@compaction/cli` is a local-first command-line tool. Everything below runs on your
16
- machine and writes local files only:
17
-
18
- - **Capture supported agent sessions.** **Claude Code is the primary supported
19
- workflow** (`capture claude-code`, Integration Readiness **Level 2**
20
- command-wrapper). Also supported: **OpenAI Agents SDK** (`capture openai-agents`,
21
- Level 2 command-wrapper) and **Codex** local-file/trace **import** (`import`,
22
- Level 1). These are local capture/import integrations **not** native/Level 3
23
- SDK instrumentation.
24
- - **Show input/output tokens and estimated spend.** `analyze` and the local report
25
- show input/output token counts and a per-run **estimated** cost. Token counts are
26
- **provider-reported** only when the captured run carries provider usage metadata;
27
- otherwise they are a **local estimate (chars/4)**. Cost is a **price-table
28
- estimate** labeled `local estimate` / `token-estimated cost` — **never
3
+ **The free, local-first CLI for capturing and measuring AI agent traces.** It captures
4
+ supported agent sessions on your own machine, shows input/output tokens and estimated spend
5
+ with honest labels, and writes local reports and redacted share bundles. Everything runs
6
+ locally and writes local files only — **no account, no telemetry, no upload by default.**
7
+
8
+ > **The free CLI captures, measures, inspects, reports, and redacts.** Optimization, advanced
9
+ > verification, apply guidance, policies, and team reporting are **not** in the free CLI — they
10
+ > are the **opt-in Compaction API**, which is **not a live hosted service yet**.
11
+
12
+ ## What the CLI does
13
+
14
+ Everything below runs on your machine and writes local files only:
15
+
16
+ - **Capture supported agent sessions.** Claude Code is the primary supported workflow
17
+ (`capture claude-code`); OpenAI Agents SDK (`capture openai-agents`) and Codex / local-file
18
+ traces (`import`) are also supported. These are local capture/import integrations **not**
19
+ native SDK instrumentation.
20
+ - **Show input/output tokens and estimated spend.** `analyze` shows input/output token counts
21
+ and a per-run **estimated** cost. Token counts are **provider-reported** only when the captured
22
+ run carries provider usage metadata; otherwise they are a **local estimate (chars/4)**. Cost is
23
+ a **price-table estimate** labeled `local estimate` / `token-estimated cost` — **never
29
24
  billing-confirmed**.
30
- - **Create local reports.** `analyze` / `compact` write local JSON + Markdown
31
- reports under an operator-chosen output directory. Local files only.
32
- - **Create redacted, content-free share bundles.** `feedback --redact` writes a
33
- redacted, privacy-safe bundle as a **local file only — never uploaded**, and only
34
- with an explicit write gesture (`--yes`).
35
- - **No upload by default.** There is **no telemetry**. The **only** network call in
36
- the free CLI is the explicitly operator-invoked, read-only `capture
37
- provider-usage` (credential supplied via an environment variable only; aggregate
38
- usage/cost figures only, no prompt/completion content).
39
-
40
- The free CLI deliberately answers the first-value question — *"where is my context
41
- being wasted, and roughly what does it cost?"*entirely locally, with honest
42
- labels.
25
+ - **Inspect spend and roll up runs.** `spend`, `summary`, and `aggregate` summarize where context
26
+ spend came from and roll up local runs — local files only, no hosted dashboard.
27
+ - **Write local reports.** `analyze` writes local JSON + Markdown reports under an
28
+ operator-chosen output directory. Local files only.
29
+ - **Create redacted, content-free share bundles.** `feedback --redact` writes a redacted,
30
+ privacy-safe bundle as a **local file only never uploaded**, and only with an explicit write
31
+ gesture (`--yes`).
32
+ - **No upload by default.** There is **no telemetry**. The **only** network call in the free CLI
33
+ is the explicitly operator-invoked, read-only `capture provider-usage` (credential supplied via
34
+ an environment variable only; aggregate usage/cost figures only, no prompt/completion content).
35
+
36
+ The free CLI deliberately answers the first-value question*"where is my context being wasted,
37
+ and roughly what does it cost?"* — entirely locally, with honest labels.
43
38
 
44
39
  ## What requires the Compaction API (opt-in — not in the free CLI)
45
40
 
46
- The following are **not** part of the free local CLI. They are the **opt-in
47
- Compaction API**:
41
+ These are **not** part of the free local CLI:
48
42
 
49
43
  - **Optimization** — producing a compacted context from a captured trace.
50
44
  - **Advanced verification** — stronger checks on what a compacted context retains.
51
- - **Apply guidance** — a readiness verdict and a review/approval path before any
52
- context is applied.
53
- - **Team reporting** — cross-run / cross-session reporting when enabled.
54
-
55
- > **The Compaction API is not broadly hosted yet.** There is **no live hosted
56
- > service today**. The API path is **designed to** optimize and verify **when you
57
- > opt in** — this README does **not** claim those run as a live service. Until the
58
- > API is available, these capabilities are **on the roadmap / opt-in**, not present
59
- > in the free CLI.
60
-
61
- When the API is available, the honesty rails carry over unchanged: cost stays an
62
- **estimate** unless billing-confirmed (no figure carries that label today);
63
- verification is **deterministic recoverability, NOT semantic/meaning preservation**;
64
- integration stays **Level 1/2**; and there is **no auto-apply** — every application
65
- is an explicit operator gesture.
66
-
67
- ## The free local loop (recommended first run: your OWN workflow)
68
-
69
- **capture → analyze / measure → (local report) → redact / share**
70
-
71
- The recommended first run is on **your own** captured/imported workflow — **not a
72
- demo**. Synthetic/demo traces exist only as illustration; they are never the
73
- recommended first value.
74
-
75
- 1. **Capture** a real workflow trace. **Claude Code is the primary supported
76
- workflow** (`capture claude-code --session <path>`, Level 2 command-wrapper).
77
- Also supported: OpenAI Agents SDK (`capture openai-agents`, Level 2) and Codex
78
- local-file import (`import`, Level 1).
79
- 2. **Analyze / measure** input/output tokens and estimated spend, and see where the
80
- spend came from (`analyze`).
81
- 3. **Local report** — read the local JSON / Markdown report written under your
82
- chosen output directory.
83
- 4. **Redact / share** — `feedback --redact` writes a redacted, content-free bundle
84
- you can hand a teammate or founder. Local file only, never uploaded.
85
-
86
- > **Optimization, advanced verification, apply guidance, and team reporting** are
87
- > the **opt-in Compaction API**, not steps of the free local CLI (see the section
88
- > above).
45
+ - **Apply guidance** — a readiness verdict and a review/approval path before any context is applied.
46
+ - **Policies & team reporting** — configurable behavior controls and cross-run / team reporting.
89
47
 
90
- ## Evidence levels and claims
91
-
92
- Every figure this tool produces carries one of these labels and nothing stronger:
93
-
94
- | Label | Meaning |
95
- |---|---|
96
- | **local estimate** | chars/4 token heuristics and price-table cost approximations computed locally |
97
- | **provider-reported token delta** | token counts read from the provider's own API response/usage metadata (operator-entered or captured); input tokens are deterministic for a fixed context+prompt |
98
- | **token-estimated cost** | a price-table estimate applied to provider-reported token counts (`price_table_estimate`) — an estimate, never a billed figure |
99
- | **operator-entered billing record** | billed costs the operator read from their own provider console; recorded, not provider-verified by this tool |
100
- | **billing-confirmed** | only with real provider billing/invoice evidence **AND** the accepted measurement criterion met on those billed runs (N ≥ 3 runs per arm AND the delta-of-means ±2·SE interval excludes zero) — the statistical criterion alone is a bar on operator-entered figures, not proof of billing, so it is never sufficient by itself — **no figure in this repository currently carries this label** |
101
-
102
- **What is NOT claimed:** no billing-confirmed savings claim; no invoice savings claim; no general savings claim (all results are workflow-scoped and caveated); no auto-apply (every application is an explicit operator gesture); no hosted service or control plane (the free CLI is local-first, file-based); no universal "no context is lost" claim; no semantic/meaning preservation claim (it stays `not_evaluated`); no native/production/Level 3 integration claim.
48
+ > **The Compaction API is not broadly hosted yet.** There is **no live hosted service today**.
49
+ > Until the API is available, these capabilities are **on the roadmap / opt-in**, not present in
50
+ > the free CLI. The honesty rails carry over unchanged: cost stays an **estimate** unless
51
+ > billing-confirmed (no figure carries that label today); verification is **deterministic
52
+ > recoverability, NOT semantic/meaning preservation**; and there is **no auto-apply** — every
53
+ > application is an explicit operator gesture.
103
54
 
104
55
  ## Install
105
56
 
106
- This is a local-first CLI. It makes no network calls by default; the only
107
- command that reaches the network is the explicitly operator-invoked
108
- `capture provider-usage`, and only when the operator supplies a credential via
109
- an environment variable. There is no telemetry.
110
-
111
- ### curl + npm / npx — AVAILABLE AT LAUNCH (pending publish; not live today)
57
+ A local-first CLI. It makes no network calls by default; the only command that reaches the
58
+ network is the explicitly operator-invoked `capture provider-usage`. There is no telemetry.
112
59
 
113
- **The public install path is not live yet.** The package is **not yet published**
114
- to npm, and the installer is not yet hosted at `cli.compaction.dev`. The commands
115
- below are the intended public install path and will work **only at launch**, once
116
- the package is published **and** the script is hosted. Do not expect them to work
117
- today.
60
+ ### npm / npx
118
61
 
119
62
  ```bash
120
- # AVAILABLE AT LAUNCH — not live today.
121
- # One-line installer (hosted at cli.compaction.dev at launch):
122
- curl -fsSL https://cli.compaction.dev/install | sh
123
- # Inspect it first (recommended): pipe to `less`, or download and read, before sh.
124
- curl -fsSL https://cli.compaction.dev/install | less
125
-
126
- # or with npm / npx, once published:
127
63
  npm install -g @compaction/cli # then: compaction init
128
64
  npx @compaction/cli init # no global install
65
+ npx @compaction/cli --help # no install at all
129
66
  ```
130
67
 
131
- The installer ([`scripts/install.sh`](scripts/install.sh)) is checked into the repo
132
- and readable now: it uses **no `sudo` by default** (installs into a user-writable
133
- prefix), makes **no network call except the npm install** (no telemetry), supports
134
- macOS + Linux, and **fails clearly if the package is not yet published** rather than
135
- faking success. Preview it without installing anything:
136
-
137
- ```bash
138
- sh scripts/install.sh --dry-run
139
- ```
140
-
141
- See [`docs/ops/install-readiness.md`](docs/ops/install-readiness.md) for the full
142
- install-readiness contract (hosting, package name, version pinning, platforms, and
143
- the pre-publish state).
68
+ The installed binary is `compaction`. After a global install, sanity-check with
69
+ `compaction --version` (→ `0.1.2`) and `compaction --help`.
144
70
 
145
- This repository is licensed under **AGPL-3.0-only** (see [`LICENSE`](LICENSE)). The
146
- npm **package name is `@compaction/cli`** (scoped, public; the installed binary
147
- stays `compaction`). It is **not yet published** — the `npm install` / `npx`
148
- commands above stay PENDING until the founder runs `npm publish`. Until publish,
149
- use the from-source path (recommended) or the local-tarball fallback below.
71
+ ### curl one-liner
150
72
 
151
- ### From source recommended today
73
+ The hosted installer at `https://cli.compaction.dev/install` is served as `text/plain` and its
74
+ only network call is the `npm install` of the published package. It uses **no `sudo` by default**
75
+ (installs into a user-writable prefix), collects **no telemetry**, supports macOS + Linux, and
76
+ **fails clearly** rather than faking success. Read it first, then run it:
152
77
 
153
78
  ```bash
154
- git clone <repo-url>
155
- cd compaction-dev
156
- npm ci
157
- npm run build
158
- # optional: expose the `compaction` binary on your PATH
159
- npm link
79
+ # Inspect it first (recommended):
80
+ curl -fsSL https://cli.compaction.dev/install | less
81
+ # Install:
82
+ curl -fsSL https://cli.compaction.dev/install | sh
83
+ # Or preview exactly what it would do without installing anything:
84
+ curl -fsSL https://cli.compaction.dev/install | sh -s -- --dry-run
160
85
  ```
161
86
 
162
- For reproducible local validation, use `npm ci` (not `npm install`).
163
-
164
- ### Local tarball install (temporary internal/tester fallback)
87
+ ## Quick start
165
88
 
166
- Until the package is on npm, an external tester can install the packed tarball
167
- directly. This is a **temporary fallback**, not the intended public path:
89
+ Run on **your own** captured/imported workflow not a demo. The recommended free local loop is
90
+ **capture analyze (local report) redact / share**:
168
91
 
169
92
  ```bash
170
- npm pack
171
- npm install -g ./compaction-cli-0.1.0.tgz
93
+ compaction init # one-time local scaffold (writes nothing until you capture)
94
+ # 1. Capture a real workflow (Claude Code shown; --discover lists local sessions):
95
+ compaction capture claude-code --discover
96
+ compaction capture claude-code --session <session.jsonl> --out ./my-trace
97
+ # 2. Measure tokens + estimated spend, and see where it came from:
98
+ compaction analyze ./my-trace/captured-trace.json
99
+ compaction spend ./my-trace/captured-trace.json
100
+ # 3. Share a redacted, content-free bundle (local file only, never uploaded):
101
+ compaction feedback --redact --yes
172
102
  ```
173
103
 
174
- The package layout is verified by `npm run smoke:package`, which packs the
175
- tarball, installs it into a scratch prefix outside the repo, and runs
176
- `compaction --help`, `compaction init`, and a capture → compact step from the
177
- installed binary. The packed tarball ships the local CLI, `README.md`, and
178
- `LICENSE` only.
104
+ Optimization, verification, and apply guidance are the opt-in Compaction API not steps of the
105
+ free local CLI.
179
106
 
180
- ### Sanity check
107
+ ## Supported local workflows
181
108
 
182
- ```bash
183
- compaction --help
184
- ```
109
+ - **Claude Code** (`capture claude-code`) — captures a real Claude Code session JSONL (optionally
110
+ including subagent transcripts), preserving provider-reported token usage from the session's own
111
+ API response metadata. `--discover` scans the local projects directory read-only (no network).
112
+ **Integration Readiness Level 2** (local command-wrapper) — not native SDK instrumentation.
113
+ Captured traces may contain local file content — review before sharing.
114
+ - **OpenAI Agents SDK** (`capture openai-agents`) — runs a local command or reads a local JSONL
115
+ export of Agents-SDK trace/span events and normalizes them. **Level 2.** Distinguishes
116
+ provider-reported usage from local estimates; never invents token metadata.
117
+ - **Codex / local-file import** (`import`) — reads a local trace-like JSON/JSONL file (including a
118
+ `codex exec --json` export) and normalizes it. **Level 1.** Codex token counts on this path are
119
+ **locally estimated (chars/4)**, not provider-reported. `compaction import --list-sources` lists
120
+ supported sources.
185
121
 
186
- ## CLI (free, local)
122
+ There is **no** native/Level 3 SDK instrumentation, no production proxy, no model routing, and no
123
+ consumer-app (ChatGPT/Claude desktop) support.
187
124
 
188
- The free local commands:
125
+ ## Commands
189
126
 
190
127
  ```bash
191
- compaction init # scaffold local config
128
+ compaction init # one-time local scaffold
192
129
  compaction capture claude-code --session <session.jsonl> [--include-subagents] --out <dir>
193
130
  compaction capture claude-code --discover [--projects-dir <path>]
194
131
  compaction capture openai-agents --out <dir> -- <command> [args...]
195
- compaction capture openai-agents --out <dir> --export <local-jsonl-export>
196
132
  compaction capture provider-usage --endpoint <url> [--credential-env-var <NAME>] [--out <dir>]
197
133
  compaction import <trace-file> --source <source> --out <dir>
198
134
  compaction import --list-sources
199
135
  compaction analyze <trace-file>
200
- compaction feedback --redact [--yes]
136
+ compaction spend <trace-or-optimization-path> # context-spend attribution
137
+ compaction summary # roll up local run reports
138
+ compaction aggregate # per-session / cross-session local rollups
139
+ compaction feedback --redact [--yes] # redacted, local-only share bundle
201
140
  ```
202
141
 
203
- ### `capture claude-code` (primary supported workflow)
204
-
205
- Captures a real Claude Code session JSONL (optionally including subagent
206
- transcripts) into the internal trace format, preserving provider-reported token
207
- usage from the session's own API response metadata. `--discover` scans the local
208
- Claude Code projects directory read-only and lists sessions with metadata (no
209
- network, no upload). This is **Integration Readiness Level 2** (local
210
- command-wrapper) — not Level 3 native SDK instrumentation. Captured traces may
211
- contain local file content — review before sharing.
212
-
213
- ### `capture openai-agents` (Level 2 command-wrapper)
214
-
215
- Runs a local command or reads a local JSONL export containing OpenAI Agents
216
- SDK-style trace/span events, normalizes the supported events into the internal
217
- trace format, and writes capture evidence locally. It distinguishes
218
- provider-reported usage from local estimates: when supported events carry provider
219
- token fields, those values are labeled provider-reported; when absent, token
220
- metadata is marked `missing`/`unknown` and **never invented**. This is local
221
- capture only (Level 2) — it does **not** scrape the ChatGPT app, use undocumented
222
- APIs, upload traces, proxy provider/model calls, switch providers/models, or add a
223
- dashboard/auth/billing.
224
-
225
- ### `capture provider-usage` (the only network call)
226
-
227
- Explicitly operator-invoked, read-only read of aggregate usage/cost from a provider
228
- usage API. The credential comes from an environment variable only (never a flag
229
- value, never logged, never written into artifacts); absence is a clean refusal. It
230
- captures aggregate token/cost figures only — no prompt/completion content. The
231
- resulting record is classified as provider-usage evidence.
232
-
233
- ### `import` (Codex / local-file traces — Level 1)
142
+ `compaction --help` lists the free local commands.
234
143
 
235
- Reads a local trace-like JSON/JSONL file (including a `codex exec --json` export),
236
- validates whether it can be converted into the internal trace format, and writes
237
- normalized intake artifacts to an output directory. Import is local and file-based
238
- only: it does not mutate the source file, upload data, call provider APIs, route
239
- models, create a hosted service, use a database, add auth, or add billing. List
240
- supported sources with `compaction import --list-sources`.
144
+ ## Privacy and security
241
145
 
242
- Codex token counts on the import path are **locally estimated (chars/4)**, not
243
- provider-reported. Live provider/runtime integrations (native Claude Code/Cursor
244
- instrumentation, live Codex launching, hosted provider APIs) remain future work; the
245
- Codex support here is intentionally local/export-file based only (Level 1).
146
+ - **No telemetry; no upload by default.** The free CLI is local-first and file-based.
147
+ - **One network call only.** `capture provider-usage` is explicitly operator-invoked and read-only;
148
+ its credential comes from an **environment variable only** (never a flag value, never logged,
149
+ never written into artifacts), and it captures **aggregate** usage/cost figures only no
150
+ prompt/completion content. Its absence is a clean refusal.
151
+ - **Captured traces can contain local content.** Capturing a session may include local file
152
+ content — review a trace before sharing it.
153
+ - **Redacted sharing.** `feedback --redact` produces a redacted, content-free bundle as a local
154
+ file; writing it requires an explicit `--yes` gesture. There is no upload path.
155
+ - **No sudo by default** in the installer; it installs into a user-writable prefix.
246
156
 
247
- ### `analyze`
157
+ ## Evidence levels and claims
248
158
 
249
- Reads a trace file and prints trace metadata, estimated input/output/total tokens,
250
- an estimated local cost, conservative waste findings, and suggested
251
- duplicate-output compaction opportunities (advisory only — the free CLI does **not**
252
- apply them; optimization is the opt-in Compaction API).
159
+ Every figure this tool produces carries one of these labels — and nothing stronger:
253
160
 
254
- ### `feedback --redact`
161
+ | Label | Meaning |
162
+ |---|---|
163
+ | **local estimate** | chars/4 token heuristics and price-table cost approximations computed locally |
164
+ | **provider-reported token delta** | token counts read from the provider's own API response/usage metadata (operator-entered or captured); input tokens are deterministic for a fixed context+prompt |
165
+ | **token-estimated cost** | a price-table estimate applied to provider-reported token counts (`price_table_estimate`) — an estimate, never a billed figure |
166
+ | **operator-entered billing record** | billed costs the operator read from their own provider console; recorded, not provider-verified by this tool |
167
+ | **billing-confirmed** | only with real provider billing/invoice evidence **AND** the accepted measurement criterion met on those billed runs (N ≥ 3 runs per arm AND the delta-of-means ±2·SE interval excludes zero) — the statistical criterion alone is a bar on operator-entered figures, not proof of billing, so it is never sufficient by itself — **no figure in this repository currently carries this label** |
255
168
 
256
- Builds a **redacted, privacy-safe feedback bundle** as a **local file only never
257
- uploaded**. Redaction is best-effort and the bundle's own README states what is
258
- included/excluded; writing the bundle requires an explicit write gesture
259
- (`--yes`/`--confirm`). There is no upload path.
169
+ **What is NOT claimed:** no billing-confirmed savings claim; no invoice savings claim; no general savings claim (all results are workflow-scoped and caveated); no auto-apply (every application is an explicit operator gesture); no hosted service or control plane (the free CLI is local-first, file-based); no universal "no context is lost" claim; no semantic/meaning preservation claim (it stays `not_evaluated`); no native/production/Level 3 integration claim.
260
170
 
261
171
  ## Known limitations
262
172
 
263
- - **The free CLI captures and measures; it does not optimize or verify.**
264
- Optimization, advanced verification, apply guidance, and team reporting are the
265
- **opt-in Compaction API** — not the free local CLI. The API is **not broadly
266
- hosted yet**.
267
- - **Cost figures are estimates or operator-entered records, not billing-confirmed.**
268
- Locally computed cost figures are price-table estimates; provider-usage records
269
- carry operator-entered/captured console figures (not provider-verified by this
270
- tool). **No figure anywhere in this repository is billing-confirmed**; the accepted
271
- criterion that could one day support such a label (N ≥ 3 per arm, ±2·SE interval
272
- excluding zero, on real billed runs) has not been met.
273
- - **Token counts are local estimates unless provider-reported usage is captured.**
274
- The default is a chars/4 estimate, labeled as such; counts are provider-reported
275
- only when the captured run carries provider usage metadata. Unknown stays unknown —
276
- output tokens, provider, or cost the data does not carry are never inferred.
277
- - **Integrations are Level 1/2, not native/production.** Claude Code and OpenAI
278
- Agents capture are **Level 2** local command-wrappers; Codex/local-file import is
279
- **Level 1**. There is **no** native/Level 3 SDK instrumentation, no production
280
- proxy, no model routing, and no ChatGPT/Claude consumer-app support.
281
- - **Advanced verification (API) is deterministic recoverability, not semantic
282
- preservation.** Where the opt-in API verifies a compacted context, it checks
283
- deterministic recoverability for a **supported** workflow; it does **not** evaluate
284
- meaning or task equivalence, and it does **not** re-run your agent through a model.
285
- SEMANTIC / meaning preservation remains **not evaluated**, and true model replay is
286
- **future work**.
287
- - **No universal "no context is lost" guarantee.** Any apply-guidance verdict from
288
- the opt-in API is **fail-closed and scoped** to supported developer-agent
289
- workflows — never a universal guarantee, and never a semantic/meaning claim.
290
-
291
- ## Product constraints
292
-
293
- - CLI-first, not web-app-first. No web framework, no database, no auth or billing, no
294
- streaming.
295
- - No provider integrations in the free CLI except the explicitly operator-invoked,
296
- read-only `capture provider-usage` (env-only credential; aggregate usage/cost only).
297
- No proxying, no model routing, no live-call interception.
298
- - No hosted service or control plane in the free CLI; no full observability dashboard.
299
-
300
- **On the roadmap / opt-in API (NOT in the free CLI; reads as future/opt-in anywhere
301
- public):** the Compaction API's optimization and advanced verification, apply
302
- guidance, and team reporting; a hosted dashboard / control plane; native (Level 3)
303
- SDK instrumentation; model routing / provider switching / live-call interception; an
304
- IDE plugin; true model replay; semantic / meaning preservation (today not
305
- evaluated); and billing-confirmed savings (no figure in this repository carries that
306
- label). **The Compaction API is not broadly hosted yet** — never imply a live hosted
307
- service exists.
308
-
309
- ## Contributing / internal docs
310
-
311
- Repository development, the marketing/docs website (`apps/web`), and contributor
312
- workflows live in the repo's internal documentation, **not** in this npm-facing
313
- README:
314
-
315
- - `AGENTS.md` — the agent operating contract.
316
- - `ROADMAP.md` — canonical strategy and the long-term path.
317
- - `docs/product/product-index.md` — the product-docs entry point (`mvp-plan.md`,
318
- `decisions.md`).
319
- - `docs/ops/install-readiness.md` — the install/publish readiness contract.
173
+ - **The free CLI captures and measures; it does not optimize or verify.** Optimization, advanced
174
+ verification, apply guidance, policies, and team reporting are the **opt-in Compaction API** —
175
+ not the free local CLI. The API is **not broadly hosted yet**.
176
+ - **Cost figures are estimates or operator-entered records, not billing-confirmed.** Locally
177
+ computed cost figures are price-table estimates; provider-usage records carry operator-entered/
178
+ captured console figures (not provider-verified by this tool). **No figure is billing-confirmed.**
179
+ - **Token counts are local estimates unless provider-reported usage is captured.** The default is a
180
+ chars/4 estimate, labeled as such. Unknown stays unknown output tokens, provider, or cost the
181
+ data does not carry are never inferred.
182
+ - **Integrations are Level 1/2, not native/production.** Claude Code and OpenAI Agents capture are
183
+ Level 2 local command-wrappers; Codex/local-file import is Level 1. There is **no** native/Level 3
184
+ SDK instrumentation, no production proxy, no model routing, and no consumer-app support.
185
+ - **Verification (opt-in API) is deterministic recoverability, not semantic preservation.** Where
186
+ the opt-in API verifies a compacted context, it checks deterministic recoverability for a
187
+ supported workflow; it does **not** evaluate meaning or task equivalence and does **not** re-run
188
+ your agent through a model. Semantic / meaning preservation remains **not evaluated**; true model
189
+ replay is future work.
190
+ - **No universal "no context is lost" guarantee.** Any apply-guidance verdict from the opt-in API
191
+ is **fail-closed and scoped** to supported developer-agent workflows never a universal
192
+ guarantee, and never a semantic/meaning claim.
193
+
194
+ ## License
195
+
196
+ [AGPL-3.0-only](LICENSE). The npm package name is `@compaction/cli` (scoped, public); the installed
197
+ binary is `compaction`.
package/dist/cli/index.js CHANGED
@@ -27,7 +27,7 @@ const program = new Command();
27
27
  program
28
28
  .name("compaction")
29
29
  .description("CLI-first trace compaction tools for AI agent workflows.")
30
- .version("0.1.0");
30
+ .version("0.1.2");
31
31
  registerAnalyzeCommand(program);
32
32
  registerAdapterCommand(program);
33
33
  registerAggregateCommand(program);
@@ -51,6 +51,29 @@ registerReviewCommand(program);
51
51
  registerRunCommand(program);
52
52
  registerSpendCommand(program);
53
53
  registerSummaryCommand(program);
54
+ // Clean default `--help` surface (v0.1.2): show ONLY the free, local-first commands
55
+ // that work without the private engine / Compaction API. Everything else (engine-gated,
56
+ // API-adjacent, and internal/operator commands) is HIDDEN from the top-level command
57
+ // list — NOT removed. Hidden commands remain fully registered and invokable by name
58
+ // (e.g. `compaction compact …`), preserving backward compatibility; engine-gated ones
59
+ // still degrade gracefully with the sanctioned message when the engine is absent.
60
+ const PUBLIC_COMMANDS = new Set([
61
+ "init",
62
+ "capture",
63
+ "import",
64
+ "analyze",
65
+ "spend",
66
+ "summary",
67
+ "aggregate",
68
+ "feedback"
69
+ ]);
70
+ for (const cmd of program.commands) {
71
+ if (cmd.name() === "help" || PUBLIC_COMMANDS.has(cmd.name()))
72
+ continue;
73
+ // commander hides a command from help via its internal `_hidden` flag; the command
74
+ // stays parseable/runnable. (No public setter exists for an already-created command.)
75
+ cmd._hidden = true;
76
+ }
54
77
  program.parseAsync(process.argv).catch((error) => {
55
78
  const message = error instanceof Error ? error.message : String(error);
56
79
  console.error(message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compaction/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },