npm package: @justdraw/cli
Description: JustDraw export pipeline CLI — validate, optimize, and publish icon sets
Latest version: 0.3.4

# @justdraw/cli

Export pipeline for icon sets. Validate, optimize, and publish SVG icons to every platform from a single source.

```bash
npx @justdraw/cli export my-icons/ --out dist/
```

Zero runtime dependencies. Single 161KB file. Node 20+.

## What it does

One repo of SVG icons in, packages for every platform out:

```
my-icons/
  manifest.json
  icons/*.svg
  icons/*.meta.json
```

```bash
justdraw validate my-icons/         # quality gate
justdraw export my-icons/ --out dist/  # SVG + AVD + manifest + browse page
justdraw npm-gen dist/              # tree-shakeable npm package
justdraw spm-gen dist/              # Swift Package Manager
justdraw gradle-gen dist/           # Android Gradle library
justdraw iconify-gen dist/          # Iconify ecosystem JSON
justdraw framework-gen dist/ --framework react  # React components
```

## Commands

### Core pipeline

| Command | Description |
|---------|-------------|
| `validate [dir]` | Quality gate: naming, metadata, path integrity |
| `lint [dir]` | Visual consistency: stroke weight, grid alignment, outliers |
| `version [dir]` | Auto-bump semver based on icon changes (add=minor, remove=major) |
| `export [dir]` | Full pipeline: validate + optimize SVG + AVD XML + manifest + pages |

### Package generators

| Command | Description |
|---------|-------------|
| `npm-gen <dist>` | Tree-shakeable ESM/CJS with TypeScript declarations |
| `spm-gen <dist>` | Swift Package Manager with vector resources |
| `gradle-gen <dist>` | Android library with VectorDrawable resources |
| `iconify-gen <dist>` | Iconify-compatible JSON for ecosystem registration |
| `framework-gen <dist>` | Component library: `--framework react\|react-native\|vue\|svelte\|web-component` |

### Documentation generators

| Command | Description |
|---------|-------------|
| `contributing [dir]` | Generate CONTRIBUTING.md from manifest metadata |
| `llms-gen <dist>` | Generate llms.txt for agent discovery ([llmstxt.org](https://llmstxt.org)) |
| `design-system-gen <dist>` | Generate DESIGN-SYSTEM.md for AI agents |

### Utilities

| Command | Description |
|---------|-------------|
| `fingerprint <svg>` | Extract style fingerprint from SVG |
| `match <svg> [...]` | Find similar icon sets by visual style |
| `registry <sub> [...]` | Icon concept registry — lookup, resolve, search, blocks |
| `notify <dist>` | Send Slack/Discord webhook with changelog |

## GitHub Actions

The typical CI pipeline:

```yaml
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
  with: { node-version: 20 }
- run: npx @justdraw/cli version .
- run: npx @justdraw/cli export . --out dist/
- run: npx @justdraw/cli npm-gen dist/
- run: npx @justdraw/cli notify dist/
```

JustDraw auto-installs this workflow on first save from the editor.

## Export output

```
dist/
  manifest.json           # set metadata + icon list
  svg/{name}.svg          # optimized, single-path, currentColor
  avd/{name}.xml          # Android VectorDrawable
  index.html              # searchable browse page
  changelog.html          # added/removed/modified since last export
```

## Options reference

Run `justdraw --help` or `justdraw <command> --help` for full flag details.

Common flags:
- `--out <dir>` output directory
- `--json` structured JSON output (lint, fingerprint, match)
- `--strict` treat warnings as errors (validate, lint)
- `--production-only` skip draft/review icons (export)

## License

MIT