CLI / DX

DESIGN.md from your shell.

dmdg-cli turns a local project or a GitHub repository into a DESIGN.md file, using the same extraction as the web app, without leaving your editor.

~/projects/acme-ui zsh ยท dmdg-cli@0.2.0
$ npm install -g dmdg-cli
added 1 package in 2s

 
$ dmdg login dmd_9f2c41ab
โœ“ Token saved securely.
  Run `dmdg whoami` to verify your account.

 
$ dmdg whoami
โœ“ Logged in as ben (GitHub ID: 1284773)

 
$ dmdg generate ./src
๐Ÿ” Found 24 source file(s). Sending to API for AI-powered extraction...
โœ“ DESIGN.md written to DESIGN.md (18432 characters)

Files are read locally and only the contents are uploaded. The document is written back to your working tree.

dmdg-cli on npm
Quickstart

Four commands, end to end.

npm package
01
Install

Install the terminal client globally or run it through npx.

npm install -g dmdg-cli
02
Authenticate

Create a token in Account, then save it locally with restricted permissions.

dmdg login <token>
03
Verify

Check that the CLI is signed in to your account.

dmdg whoami
04
Generate

Scan a project locally and write a DESIGN.md file.

dmdg generate ./src

Your token is stored locally in ~/.config/design-md/config.json with 0600 permissions, never in project files or command URLs.

Reference

Commands.

dmdg login <token>
Save your API token locally
dmdg logout
Remove the saved API token
dmdg whoami
Show the authenticated GitHub user
dmdg generate <path>
Generate DESIGN.md from local files
dmdg generate <repo> --repo
Generate DESIGN.md from a GitHub repo
dmdg init [dir]
Scaffold a .designmdrc config file
dmdg init [dir] --template
Also create a starter DESIGN.md template

Options

dmdg generate <path> --repo       # Treat path as owner/repo
dmdg generate <path> -o <file>    # Output file (default: DESIGN.md)
Under the hood

What runs when.

  1. 01
    Scan

    Recursively discovers supported files in the target directory.

  2. 02
    Read

    Reads raw file contents locally on your machine.

  3. 03
    Send

    Uploads file contents with your bearer token.

  4. 04
    Extract

    Server parses colors, fonts, spacing, shadows, components.

  5. 05
    Enhance

    AI enrichment produces a structured DESIGN.md.

  6. 06
    Write

    The document lands on your filesystem, ready to commit.

The CLI is a thin client: parsing, normalization, and AI enhancement all happen server-side.

Scaffolding

Project config.

dmdg init ./my-project --template

Drops a .designmdrc in the target directory so file discovery stays explicit. It is discovered automatically on every generate.

{
  "include": ["src/**/*.{css,scss,html}", "*.{css,scss,html}"],
  "exclude": ["node_modules", "dist", "build"],
  "output": "DESIGN.md"
}
Discovery

What gets sent.

.css.scss.less.sass.html.htmtailwind.config.*postcss.config.*vite.config.*svelte.config.*package.json

Files above 10 MB are skipped with a warning instead of failing the run.

Discovery

Always ignored.

node_modules.gitdistbuild.svelte-kit.nextoutcoverage.wrangler

Add your own patterns to exclude in .designmdrc.

Environment

Variables & alternatives.

DESIGN_MD_TOKEN

API token, as an alternative to dmdg login.

DESIGN_MD_API_BASE

API base URL. Defaults to the public instance.

npx dmdg-cli

Run without installing anything globally.

Prefer the browser? The web app extracts from a URL, repo, image, or written brief.

Back to the extractor