CLI Overview

The dna CLI provides ten commands. Three are the main workflow (start, check, hook install); the rest are supporting instruments.

Command reference

CommandWhat it does
dna startExtract design identity from the codebase → .dna/identity.yaml
dna checkRun conformance: lint · cn-merge guard · rendered · manifests
dna resolveReverse-lookup a raw value → identity token, before you write the literal
dna allowAdopt a deliberate exception into the identity, with provenance and a required reason
dna inventoryList the component library parsed from code
dna similarDetect rebuilds of existing components and clones of net-new shapes (advisory)
dna shapesDerive a component vocabulary from committed Figma frame dumps
dna gen-manifestGenerate structural screen manifests from design frames
dna figma diffAdvisory structural change detector: committed frame dump vs a fresh one
dna hook installInstall a pre-commit hook that runs dna check
dna mcpStart the MCP server (see MCP Overview)

Global flags

FlagEffect
--cwd=<path>Project root to operate on (defaults to process.cwd())
--config=<path>Path to ds-lint.config.json
--jsonMachine-readable JSON output (supported by inventory, similar)

Exit codes

The exit convention depends on whether a command gates or advises:

Command classExit behavior
Gatingdna check0 = clean or nothing-to-check · 1 = violations found
Advisorydna similar, dna figma diffAlways 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.