CLI Reference
The official DesignMD Pro CLI (designmdpro on npm) lets you search and pull curated DESIGN.md specifications, wire them into AI coding tools, compile theme files, validate tokens, diff revisions, and gate CI on design drift.
Running the CLI
Run any command without installing globally via npx (requires Node.js 20+):
npx designmdpro pull linear
npx designmdpro lint DESIGN.mdIf you use the CLI frequently, install it globally to use the short dmdp binary:
npm install -g designmdpro
dmdp --helpEvery command works with both npx designmdpro <command> and dmdp <command>.
Authentication and Pro access
Free design systems work without an account (search, pull, versions, init, export, mcp install, lint, diff, check).
A DesignMD Pro API key (dmdp_…) unlocks Pro design systems in pull, search, and export, plus the extract command:
-
Sign in and create a key in Account → API Keys.
-
Save it locally:
npx designmdpro login npx designmdpro whoami
| Command | What it does |
|---|---|
npx designmdpro login [--key dmdp_…] | Verify and save the API key to ~/.config/designmdpro/config.json (0600) |
npx designmdpro logout | Remove the saved API key from the local config file |
npx designmdpro whoami | Show the active account, plan, masked key, and where the key was resolved |
In CI, set the DESIGNMDPRO_API_KEY environment variable instead of running login. Key resolution order is --api-key, then $DESIGNMDPRO_API_KEY, then ~/.config/designmdpro/config.json.
Commands
Pull and search design systems
| Command | What it does |
|---|---|
npx designmdpro search [query] [-c category] [--access all|free|pro] [-l 20] | Search the directory; interactive mode lets you pick a site and revision and write DESIGN.md |
npx designmdpro pull [slug[@version]] [-v ver] [-s sections] [-o file] [--stdout] | Download a DESIGN.md file; -s colors,typography keeps only selected sections; -f overwrites |
npx designmdpro versions <slug> | List all published revisions with release dates, token counts, and changelogs |
# Interactive search and pull
npx designmdpro search
# Pull a specific revision and only keep Colors and Typography
npx designmdpro pull linear@1.0.0 -s colors,typography -o DESIGN.mdWire into AI tools and MCP
| Command | What it does |
|---|---|
npx designmdpro init [-t claude-code cursor …] [-d DESIGN.md] [--from slug] [--dry-run] | Add DESIGN.md references to Claude Code, Cursor, Windsurf, Copilot, Codex, and Kiro rule files (idempotent) |
npx designmdpro mcp install [-c clients…] [--scope user|project] [--key … | --no-key] | Write https://www.designmdpro.app/mcp into client MCP configs (claude-code, cursor, windsurf, vscode, codex, kiro) |
--scope project references $DESIGNMDPRO_API_KEY instead of writing a literal key into repository config files.
# Pull a design system and wire Claude Code + Cursor rules in one step
npx designmdpro init --from linear --target claude-code cursor
# Install the hosted MCP server into Cursor
npx designmdpro mcp install --client cursorExport themes and prompts
| Command | What it does |
|---|---|
npx designmdpro export [source] -F tailwind|css|shadcn|v0|cursor|claude-code [-o file] | Compile a local file, - (stdin), or cloud ref (slug[@version]) into framework output |
npx designmdpro export -F tailwind -o app/theme.css
npx designmdpro export linear -F shadcn --remote -o app/globals.cssLint and diff
| Command | What it does |
|---|---|
npx designmdpro lint [source] [--strict] [--remote] | Validate a local file (default DESIGN.md), - (stdin), or cloud ref with @google/design.md + DesignMD Pro rules |
npx designmdpro diff <before> [after] [--exit-code] [--fail-on-regression] | Compare tokens and lint findings between two files or a cloud revision (e.g. stripe@1.0.0) and local DESIGN.md |
lintexits1on errors (--strictalso fails on warnings). See Validator & Lint Rules for every rule.diff --exit-codeexits1when tokens differ;--fail-on-regressionexits1when lint errors or warnings increase.
npx designmdpro lint DESIGN.md --strict
npx designmdpro diff stripe@1.0.0 DESIGN.md --fail-on-regressionExtract and visual drift check
| Command | What it does |
|---|---|
npx designmdpro extract <url> [-o file] [--stdout] [-n brand] [--quota] | Pro: render a public URL on DesignMD Pro and write a draft DESIGN.md (daily quota, default 20/UTC day) |
npx designmdpro check <url> [-d DESIGN.md] [-t 3] [--strict] [--color-scheme dark] [--viewport 1440x900] | Render a page in local Chrome/Chromium and exit 1 when colors or fonts drift from DESIGN.md |
extract vs check
extractruns in DesignMD Pro’s server-side headless browser behind an SSRF guard, so it accepts public URLs only and consumes 1 unit of daily quota (failed page loads are refunded).checkruns entirely locally using your installed Chrome/Chromium (--chrome,$CHROME_PATH, or auto-detected), solocalhostand private preview deployments work with zero quota usage.
check maps rendered elements onto semantic roles (background, surface, text, text-muted, border, primary, on-primary, accent) and compares each against the DESIGN.md palette in OKLab (ΔE × 100, --tolerance, default 3):
drift(fails): no palette token is within tolerance, or a heading/body font family is missing fromtypography.mismatch(warning): the color exists in the palette, but under a different token than the role’s expected name.unmapped(warning): theaccentrole has no matching token.- Off-palette colors covering
≥ 5%of a channel are reported as warnings.
Pass --strict to fail on warnings too, and --color-scheme dark to compare against <name>-dark tokens.
# .github/workflows/design-drift.yml
name: Design drift check
on: [pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: browser-actions/setup-chrome@v1
id: chrome
- run: npx --yes designmdpro check "$PREVIEW_URL" --chrome "${{ steps.chrome.outputs.chrome-path }}" --jsonGlobal flags and exit codes
Global flags can appear in any position:
--json— output a single JSON document on stdout and disable interactive prompts--no-input— disable prompts (also implied by--json,CI, and non-TTY streams)--api-key <key>— override the API key for this invocation--api-url <url>— override the API origin (defaulthttps://www.designmdpro.app)-v, --version/-V, --cli-version— print the CLI version
| Exit code | Meaning |
|---|---|
0 | Success |
1 | Failed check (lint, diff, check) or error |
2 | Invalid arguments or usage error |
3 | Authentication, Pro plan, or quota required |
4 | Resource or file not found |
5 | Network or upstream error |
Next steps
- Installation & CLI — repository layout and GitHub Actions setup
- Validator & Lint Rules — every lint rule and WCAG contrast check
- MCP Server Reference — connect agents directly to
https://www.designmdpro.app/mcp