CLI Overview
The dna CLI provides ten commands. Three are the main workflow (start, check, hook install); the rest are supporting instruments.
Command reference
| Command | What it does |
|---|---|
dna start | Extract design identity from the codebase → .dna/identity.yaml |
dna check | Run conformance: lint · cn-merge guard · rendered · manifests |
dna resolve | Reverse-lookup a raw value → identity token, before you write the literal |
dna allow | Adopt a deliberate exception into the identity, with provenance and a required reason |
dna inventory | List the component library parsed from code |
dna similar | Detect rebuilds of existing components and clones of net-new shapes (advisory) |
dna shapes | Derive a component vocabulary from committed Figma frame dumps |
dna gen-manifest | Generate structural screen manifests from design frames |
dna figma diff | Advisory structural change detector: committed frame dump vs a fresh one |
dna hook install | Install a pre-commit hook that runs dna check |
dna mcp | Start the MCP server (see MCP Overview) |
Global flags
| Flag | Effect |
|---|---|
--cwd=<path> | Project root to operate on (defaults to process.cwd()) |
--config=<path> | Path to ds-lint.config.json |
--json | Machine-readable JSON output (supported by inventory, similar) |
Exit codes
The exit convention depends on whether a command gates or advises:
| Command class | Exit behavior |
|---|---|
Gating — dna check | 0 = clean or nothing-to-check · 1 = violations found |
Advisory — dna similar, dna figma diff | Always 0 when the command ran — findings report but never gate. Non-zero means a hard error only (e.g. a malformed frame dump), i.e. "couldn't compute a trustworthy answer", never "something was found." |
Warnings never cause a non-zero exit — they are advisory.
Configuration
DNA reads ds-lint.config.json at the project root. A minimal config:
{
"includePaths": ["src"],
"inventory": {
"dirs": ["src/components"]
},
"similar": {
"threshold": 0.8,
"enabled": true
}
}
dna start writes this file automatically if none exists.