Spec 04
CLI
The uidna command
One command per tool, plus setup, doctor and serve. Add --json to any of them to see the envelope.
04.1Commands
| Command | Tool | Answers |
|---|---|---|
uidna scan <url> | scan_interface | What is on each page at each viewport, and where does the layout change? --crawl for a site, --capture-bodies json for data, --responsive to tune probing. Creates ./.uidna/<scan-id>/. |
uidna explore <scan> | explore_interactions | What changes when I interact? --policy safe (default) or forms; --pages and --viewports narrow it; --no-collections skips search boxes. |
uidna inspect <scan> | inspect_dna | Summary, one facet, one path, or the whole document. |
uidna element <scan> <state> | inspect_element | One node: box, style, tokens, a11y, form facts, ancestors, evidence. |
uidna components <scan> | search_components | Fingerprinted component candidates in stable order, matched across pages. |
uidna tokens <scan> | extract_tokens | Token clusters with member values and sample counts. |
uidna annotate <scan> <patches> | annotate_dna | Apply the agent's readings with inferred / agent provenance. |
uidna generate <scan> <outDir> | generate_project | The React project, installed and built. --router, --no-behavior-tests. |
uidna verify <scan> <outDir> | verify_reconstruction | The DiffReport for this attempt, with regressions and resolved findings. --run-generated-tests. |
uidna report <scan> | report_reconstruction | The static HTML report. |
uidna export <scan> | export_evidence | A portable evidence bundle with a manifest of digests. |
uidna reconstruct <url> <outDir> | reconstruct_interface | The whole loop. |
Every tool returns the same envelope; add --json on the CLI to see it:
{
"result": {},
"evidence_id": "ev_3f9a1c7b2d4e",
"evidence": { "kind": "scan", "inputs": {}, "artifacts": [], "capturedAt": "2026-10-13T17:29:00.000Z" },
"limitations": [],
"unknowns": []
}The full catalog, generated from the contracts, is in docs/tools.md.
04.2Global options
| Option | Effect |
|---|---|
--json | print the evidence envelope as JSON |
--debug | verbose diagnostics on stderr |
--out-root <dir> | directory that holds scans (default ./.uidna) |
--cwd <dir> | working directory for config and relative paths |
04.3uidna setup
Register the MCP server in Claude Code, Codex and Cursor (prints the plan, asks, backs up).
$ uidna setup| Option | Effect |
|---|---|
--targets <list> | comma-separated: claude-code,codex,cursor (default all) |
--scope <scope> | user (default) or project |
--local | register this checkout (node dist/cli.js serve) instead of npx -y uidna-mcp@latest serve |
--yes | apply without asking |
--no-backup | do not back up existing config files |
04.4uidna doctor
Report browser availability, CDP reachability and registration state.
$ uidna doctor| Option | Effect |
|---|---|
--cdp <endpoint> | CDP endpoint to probe (default from config or http://localhost:9222) |
04.5uidna serve
Start the MCP server on stdio (what the registered command runs).
$ npx -y uidna-mcp@latest serve04.6Configuration
Optional uidna.config.json in the working directory. Environment variables win over the file.
| Key | Meaning |
|---|---|
outRoot | Directory that holds scans. Default .uidna. |
viewports | Default viewport widths. |
budget | Per-scan budget: timeMs, pages, actions, resources (null for no limit). |
denyNames | Additional accessible-name words the explorer must never click. |
headless | Launch mode for the Playwright browser. Default true. |
cdpEndpoint | Default CDP endpoint for doctor and attach mode. |
debug | Verbose diagnostics on stderr. |
| Environment variable |
|---|
UIDNA_OUT_ROOT |
UIDNA_DEBUG |
UIDNA_CDP_ENDPOINT |
UIDNA_HEADLESS |