UI DNA

Specifications · rev 0.3.1

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

CommandToolAnswers
uidna scan <url>scan_interfaceWhat 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_interactionsWhat changes when I interact? --policy safe (default) or forms; --pages and --viewports narrow it; --no-collections skips search boxes.
uidna inspect <scan>inspect_dnaSummary, one facet, one path, or the whole document.
uidna element <scan> <state>inspect_elementOne node: box, style, tokens, a11y, form facts, ancestors, evidence.
uidna components <scan>search_componentsFingerprinted component candidates in stable order, matched across pages.
uidna tokens <scan>extract_tokensToken clusters with member values and sample counts.
uidna annotate <scan> <patches>annotate_dnaApply the agent's readings with inferred / agent provenance.
uidna generate <scan> <outDir>generate_projectThe React project, installed and built. --router, --no-behavior-tests.
uidna verify <scan> <outDir>verify_reconstructionThe DiffReport for this attempt, with regressions and resolved findings. --run-generated-tests.
uidna report <scan>report_reconstructionThe static HTML report.
uidna export <scan>export_evidenceA portable evidence bundle with a manifest of digests.
uidna reconstruct <url> <outDir>reconstruct_interfaceThe whole loop.

Every tool returns the same envelope; add --json on the CLI to see it:

json

{
  "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

OptionEffect
--jsonprint the evidence envelope as JSON
--debugverbose 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).

bash

$ uidna setup
OptionEffect
--targets <list>comma-separated: claude-code,codex,cursor (default all)
--scope <scope>user (default) or project
--localregister this checkout (node dist/cli.js serve) instead of npx -y uidna-mcp@latest serve
--yesapply without asking
--no-backupdo not back up existing config files

04.4uidna doctor

Report browser availability, CDP reachability and registration state.

bash

$ uidna doctor
OptionEffect
--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).

bash

$ npx -y uidna-mcp@latest serve

04.6Configuration

Optional uidna.config.json in the working directory. Environment variables win over the file.

KeyMeaning
outRootDirectory that holds scans. Default .uidna.
viewportsDefault viewport widths.
budgetPer-scan budget: timeMs, pages, actions, resources (null for no limit).
denyNamesAdditional accessible-name words the explorer must never click.
headlessLaunch mode for the Playwright browser. Default true.
cdpEndpointDefault CDP endpoint for doctor and attach mode.
debugVerbose diagnostics on stderr.
Environment variable
UIDNA_OUT_ROOT
UIDNA_DEBUG
UIDNA_CDP_ENDPOINT
UIDNA_HEADLESS