|
Use this page for its local concern first. Return to Documentation Index when you need the broader map. |
|
Track A produces proof-grade artifacts such as bundles, manifests, hashes, and verification results. Track B produces hypotheses, exploratory reasoning, and live workspace investigation state. Use the proof path when later humans or CI must trust the output. Use the live path when the work is still moving. |
cx is a repository-native toolchain with a kernel-owned proof path, a
live MCP workspace surface, and a durable notes layer for AI handoff and
verification.
Use Operating Modes for the main conceptual entrypoint and Mental Model for the canonical CX triad, Track A vs Track B, policy tiers, and artifact lifecycle.
Use this manual when you already know you are operating cx and want
the shortest route to commands, assurance levels, and workflow
decisions.
If you are new to the repository:
-
Read the root README
-
Read System Map
-
Return here once you need the operator path instead of the conceptual map
Quick Operator Path
Use the smallest operator sequence that matches the job:
-
Live workspace path:
cx mcp -
Durable cognition path:
cx notes -
Curated docs review path:
cx docs export -
Native proof path:
cx inspect,cx bundle,cx validate,cx verify,cx extract -
Recovery or audit:
cx list,cx audit,cx doctor -
Adapter/oracle path: expert diagnostics and parity only, not the primary operator workflow
Typical minimal paths:
Live Agent Path
-
cx mcp -
cx doctor mcp -
cx mcp catalog --json -
cx doctor workflow --task "refactor index.ts"
Artifact Path
-
cx init --name demo -
cx inspect --token-breakdown -
cx bundle --config cx.toml -
cx verify --against . -
cx extract dist/bundle --to ./restore
Extraction Safety
When you extract bundle contents, treat intact and copied outputs as the ordinary safe path.
If extraction reports degraded, stop and decide whether you need approximate human review or deterministic machine-safe recovery:
-
use
cx extract … --allow-degradedonly for human inspection -
do not use degraded output as automation input
-
rebuild the bundle instead of forcing degraded fallback when coordinates, hashes, or downstream edits matter
Why this protects you: degraded extraction means the recovered packed content no longer matches the manifest contract, so line coordinates and file identity may no longer be trustworthy enough for safe automation.
For the full failure model, recovery statuses, and detailed examples, see Extraction Safety.
Audited Overrides
cx bundle --force and cx bundle --ci are audited overrides. They allow a bundle to be materialized from tracked-file drift only when the operator has chosen that provenance explicitly, and the manifest records forced_dirty or ci_dirty for downstream review. --force also keeps the command running after note-validation errors, so the operator can inspect the resulting artifact and the emitted diagnostics together. Scanner findings remain fatal.
See Audited Overrides before using either flag in release or CI workflows.
Repository Commands
Use the repository-local make targets for day-to-day development:
| Command | Use it when |
|---|---|
|
You want the fast unit loop while iterating |
|
You want the normal local gate before merging |
|
You want CI-grade confidence before tagging a release |
|
You are stepping through the two-phase release wizard |
make certify runs everything make verify does, then performs a clean
double-build reproducibility check: the dist/ tree is hashed, wiped,
rebuilt, and hashed again. The two hash sets must match exactly. This
mirrors the CI reproducibility job so the release gate is exercisable
locally without pushing.
Assurance Ladder
Use these commands as a progressive assurance model:
| Command | What it covers | When to run |
|---|---|---|
|
lint, typecheck, build, Vitest coverage lane, Bun compatibility smoke |
normal pre-merge gate |
|
Vitest V8 coverage lane with HTML, JSON summary, LCOV, and markdown summary output over the full shared suite |
CI coverage reporting |
|
full shared repository suite through native Vitest |
broad local execution proof |
|
focused bundle workflow, extraction, render-adapter, and JSON CLI lane |
bundle-heavy local iteration |
|
focused notes graph, note commands, linked-note planning, and operator contract lane |
notes-heavy local iteration |
|
focused planning and schema-integration lane |
overlap, linking, and config-shape iteration |
|
|
pre-tag local CI-equivalent certification |
|
release integrity metadata generation from the packed npm tarball |
release artifact staging |
|
release integrity metadata verification against packed tarball |
release verification and audit |
make verify and make certify are thin wrappers around
bun run verify and bun run certify.
Vitest coverage is now the authoritative coverage-reporting lane for release assurance. Bun remains part of the execution and compatibility matrix.
CX Commands
Use cx commands for repository planning, bundle generation,
verification, and live MCP work.
cx init --name demo
cx docs export
cx inspect --token-breakdown
cx bundle --include-doc-exports
cx bundle --config cx.toml
cx mcp
cx doctor mcp --config cx.toml
cx mcp catalog --json
cx doctor secrets --config cx.toml
cx notes lint
cx notes lint --write
cx init now writes a generated workspace-aware Makefile,
.editorconfig, cx-mcp.toml, cx.toml, .mcp.json,
.vscode/mcp.json, and local agent settings in .claude/settings.json
and .codex/settings.json in addition to notes/. The generated
cx-mcp.toml is a minimal diff to cx.toml and serves as the MCP
overlay for the workspace root. The Makefile selects a language-specific
template when it sees common workspace markers for Rust, Go,
JavaScript/TypeScript, Python, Java, Elixir, Julia, Crystal, or Zig, and
otherwise falls back to the base template.
For the TypeScript template, the generated Makefile uses
lockfile-first package-manager selection (bun.lock*,
pnpm-lock.yaml, yarn.lock, then package-lock.json /
npm-shrinkwrap.json) and keeps install separate from build. The
normalized local targets are install, build, test, check,
lint, verify, certify, clean, and notes. lint and check
skip with a clear message when the corresponding package scripts are
absent, and certify falls back to verify unless the workspace
defines a stricter package-manager certify script. The generated
cx-mcp.toml is the source-oriented authoring overlay and includes
src/, package.json, tsconfig*.json, and README.md
while excluding node_modules/, dist/**, and common
cache or coverage directories. A companion cx-mcp-build.toml is
generated for compiled-output inspection. Adjust the authoring and build
overlays independently if your workspace uses a different layout.
The cross-template capability matrix, generated file contract, and support levels are documented in Init Template Contract.
cx init checks each generated target individually. It preserves
existing files by default and creates any missing init artifacts; use
--force to overwrite existing generated files.
Use --template to explicitly choose an init template by environment:
cx init --name demo --template typescript
List supported templates with:
cx init --template-list
When --template is omitted, cx init autodetects the workspace
environment from files like package.json, go.mod, pyproject.toml,
pom.xml, and Cargo.toml.
cx mcp prefers a colocated cx-mcp.toml overlay. If that file is
present, it is the default MCP config for the workspace; if it is
missing, cx falls back to the baseline cx.toml configuration. The
MCP surface now includes live bundle planning plus note reading, search,
creation, update, rename, delete, and note-graph inspection tools in
addition to workspace file browsing.
cx docs export writes deterministic markdown renderings of the Antora
assemblies described by the active playbook so operators and downstream
LLM workflows can
inspect the final documentation content directly instead of inferring it
from source AsciiDoc files alone. MultiMarkdown is the default export
format for this command. The export rewrites Antora-style cross references
into review-friendly links between the emitted markdown files and reports
unresolved review-link destinations such as xref: links,
module-qualified Antora HTML targets, or .adoc destinations. Use
--playbook when the docs are driven by a playbook other than the
default antora-playbook.yml at the source root, and use --root-level
to switch between a single combined assembly (0) and one export per
assembly or module (1, the default). JSON mode reports structured
diagnostics when the export is blocked so CI and operators can see the
exact assembly and unresolved destinations instead of only receiving a
generic failure. Use --log-output <path> when you want Antora export
logs written to a file instead of stderr. This overrides
docs.log_output from cx.toml. Empty log files are deleted
automatically after the export, so a log path only remains on disk when
it captured actual output.
cx bundle --include-doc-exports reuses that same export path and stages
the generated Antora assemblies under docs.target_dir/ inside the bundle. The
default is {project}-docs-exports, and you can configure it the same
way as assets.target_dir in cx.toml. The bundle manifest records
those files as .mmd.txt artifacts in derivedReviewExports so they
are discoverable, checksum-covered, and still clearly labeled as derived
review material rather than proof-path section outputs. cx inspect
--derived-review-exports --json and cx verify --json also summarize the
derived review exports, including unresolved review-link diagnostics for already
bundled artifacts. When bundled docs export logging is enabled, the log
is written to antora-export.log.txt in the bundle root. Empty bundled
log files are removed automatically and are not recorded as bundle
content or handover inventory.
Use cx mcp catalog --json when you need only the machine-readable MCP
tool contract. It exposes the registered tool set with stable name,
capability, and stability fields plus summary counts, without mixing
in profile resolution or audit state.
For concrete integration examples and per-IDE snippets (VS Code/Cline, Roo Code, Cursor, Claude Desktop), see the Agent Integration Guide.
MCP Setup And Daily Operator Use
Use this sequence when you are connecting an agent or IDE to a live workspace:
-
Run
cx mcpfrom the repository root. -
Confirm the resolved profile and file boundary with
cx doctor mcp. -
Inspect the machine-readable tool contract with
cx mcp catalog --json. -
Use
cx-mcp.tomlwhen you need an MCP-specific overlay; otherwisecxfalls back tocx.toml.
Keep the everyday operator rule simple:
-
use
cx mcpfor live reads, searches, planning, and note work -
use
cx bundle,cx validate,cx verify, andcx extractfor proof-path artifacts -
keep client-specific setup details in the repository reference guide, not in the front-door operator path
If an agent cannot see the right files, verify these before debugging anything deeper:
-
cwdpoints at the repository root -
the active profile is the one you expect
-
files.includeandfiles.excludematch the intended workspace scope -
mutation is enabled only when you intentionally want a mutate-capable session
Repository-local make shortcuts keep the developer loop compact:
-
make testruns the fast Vitest unit suite. -
make verifyruns lint, typecheck, build, the Vitest coverage lane, and Bun compatibility smoke. -
bun run ci:test:coverageruns the authoritative Vitest V8 coverage lane across the shared repository suite, then writescoverage/vitest/plus.ci/coverage-summary.mdfor CI reporting. -
Treat that Vitest lane as the authoritative release-assurance reporting surface. The Bun lanes still prove execution compatibility and remain part of the runtime matrix.
-
bun run test:contractsruns the contract suite through native Vitest. -
bun run test:allruns the full shared suite through native Vitest without collecting coverage. -
bun run test:all:fullis the explicit Vitest coverage lane for local release-assurance checks. -
bun run test:vitest:bundleisolates the slow bundle workflow, extraction, render-adapter, and JSON CLI suites. -
bun run test:vitest:notesisolates the slow notes graph and command suites, plus linked-note planning and operator contracts. -
bun run test:vitest:planningisolates planning and schema-integration suites for overlap, linked-note, and config-shape work. -
bun run pages:buildassembles the public Pagesdist/site/tree with/schemas/,/coverage/, and the curated Antora docs site under/docs/. -
bun run pages:smokevalidates the stageddist/site/tree before a workflow publishes it. -
The latest public HTML coverage view is published at
https://wstein.github.io/cx-cli/coverage/from successfuldevelopormainCI runs. -
The curated docs site is published at
https://wstein.github.io/cx-cli/docs/. -
bun run test:vitest:mcpruns the focused MCP cockpit lane for MCP-heavy tests without starting the full repository coverage surface. -
bun run test:vitest:mcp:uiopens the same MCP-focused lane in Vitest UI so operators can rerun failures, inspect coverage, and review the import graph for slow MCP startup or registration paths. -
bun run test:vitest:mcp:adversarialkeeps startup failures, malformed runtime responses, and other hostile-boundary MCP cases isolated in a smaller cockpit. -
make certifyruns everythingverifydoes plus contract tests, smoke lanes, release integrity smoke, and reproducibility checks - the CI-grade local gate to use before tagging. -
make release VERSION=vX.Y.Zis a wizard: first call starts the release candidate ondevelop, second call with that same tagged version finalizes the release after CI is green.
The make targets are wrappers around the corresponding Bun scripts.
Use them for local ergonomics; use cx when you are working with bundle
planning, verification, extraction, or MCP sessions.
The native MCP server exposes file-based list, grep, and read
tools over the workspace scope. It also exposes inspect, bundle,
doctor_mcp, and doctor_workflow tools for live planning,
plus note-native notes_read, notes_search, notes_new,
notes_update, notes_rename, notes_delete,
notes_list, notes_backlinks, notes_orphans,
notes_code_links, and notes_links tools over the notes
corpus. Use list to enumerate visible files, grep to search their
contents, and read to inspect a specific file with optional line
anchors without switching back to the packaging workflow.
Example note search:
{
"tool": "notes_search",
"arguments": {
"query": "workflow",
"tags": ["agent"],
"limit": 5
}
}
CLI and MCP note commands side by side:
| Task | CLI | MCP |
|---|---|---|
Create a note |
|
|
Read a note |
|
|
Update a note |
|
|
Rename a note |
|
|
Delete a note |
|
|
Inspect the graph |
|
|
Use the CLI for direct on-disk note lifecycle operations. Use MCP when the agent needs live search, reads, updates, or graph inspection inside an active workspace session.
cx docs compile --profile architecture|manual|onboarding is the
repository-owned promotion path from stable notes into generated Antora
pages. Use note graph tools to validate and inspect note evidence before
running docs compilation.
Who This Manual Is For
This guide is for engineers running cx as an operational tool: local
bundle authors, CI maintainers, and remote-runner owners.
If you are new to the project, read the README first. If you need the detailed knobs, read Configuration Reference. If you need the full documentation map, read Documentation Index.
Friday To Monday Map
Read the rest of this manual with one concrete timeline in mind:
-
SHA-256 sidecars prove the emitted artifacts were not silently edited after bundling.
-
The manifest records the exact file inventory, token counts, note summaries, and dirty-state provenance that downstream automation relies on.
-
verifyexists so Monday’s runner can compare the bundle back to a source tree instead of trusting a stale directory by habit. -
Dirty-state gating stops tracked-file drift from becoming an unreviewable production input.
The invariants are the mechanisms that keep Friday’s intent queryable and safe on Monday.
See Friday to Monday.
Static Bundle Versus Live MCP
See Mental Model.
The two main CX workflows are intentionally different:
-
cx bundleproduces a static, immutable snapshot for CI, review, verification, and handoff. -
cx mcpexposes the live workspace through scoped file, search, and note tools for active investigation.
They share the same repository boundary rules, but they answer different questions. Use the bundle when you need something you can verify later. Use MCP when you need the model to explore, search, or update the workspace during an ongoing task.
| Command | Best for | Typical output |
|---|---|---|
|
Reviewing the planned bundle before writing files |
A deterministic plan, token totals, overlap signals, and extractability hints |
|
Producing an immutable artifact for review, CI, or handoff |
Bundle files, manifest, lock file, and checksum sidecar |
|
Exploring the live workspace and maintaining notes during active work |
Scoped file search, reads, and note tools over the current workspace |
Native Path Versus Adapter Path
The shipped operator workflow is kernel-first:
-
cx bundle,cx validate,cx verify, andcx extractoperate on the native proof path -
cx mcpoperates on the live workspace path -
cx notesoperates on the durable cognition path
The adapter/oracle surface is separate and expert-facing:
-
used for parity diagnostics
-
used for oracle capability inspection
-
used for migration and reference testing
-
not required for ordinary bundle, validate, verify, or extract flows
-
not the primary operator story
Core Commands
| Command | Use it when |
|---|---|
|
You need a starter config |
|
You want to preview the plan before building |
|
You want to produce the bundle artifacts |
|
You want schema and structure validation |
|
You want checksum and source-tree verification |
|
You want to browse stored files and statuses |
|
You want to restore selected files from the bundle |
|
You want to start the MCP server with the agent profile |
|
You want to manage notes or inspect note graph relationships |
|
A plan fails because one file matches multiple sections |
|
You want exact exclude entries generated or applied |
|
You want to review the effective MCP profile, inherited scopes, and recent audit trends |
|
You want the narrow machine-readable MCP tool catalog for automation |
|
You want to audit note-to-code references against the VCS-backed planning master list |
|
You want to scan the master list for suspicious secret patterns |
|
You want a quick recommendation for bundle, inspect, or MCP, including mixed-task paths |
|
You want recent |
|
You want shell-native command and flag completion |