Skip to content

CLI Overview

The Specs command-line interface (CLI) generates design system specifications from Figma REST API data without requiring the Figma Plugin UI. It enables automation, batch processing, and CI/CD integration.

Commands

CommandPurposeOutput
initInitialize config files with defaultsconfig/conventions/ (one file per platform), config/settings.yaml
fetchDownload raw REST payloads from FigmaJSON files in data.directory
scanList all components in fileMarkdown manifest
applyCustomTokensInject $custom objects into fetched dataModified variables/styles JSON
generateGenerate specs from a manifest or single componentYAML/JSON spec file(s)
analyzeRun analyzers over generated specsReports in analysis/
migrateConvert older workspace layouts to the current oneRewritten config/ files
versionVersion the workspace: diffs, semver bumps, reports, changelogsversions/ folders, ledgers, reports
skillsInstall the premerge and release orchestration skillsSkill files in .claude/skills/
react (experimental)Emit the React targetComponents, contracts, stylesheets, stories in react/
webcomponents (experimental)Emit the Web Components targetElements, contracts, stylesheets, stories in webcomponents/
bridge (experimental)Start/stop/check the local bridge render talks toBackground process
cache (experimental)Build the lookup tables render resolves specs againstYAML files in {data.directory}/cache
render (experimental)Send a spec to the CLI bridge to render it live in FigmaLive Figma component

Global Options

  • --help - Show command help (all commands)
  • --version - Show CLI version
  • --verbose - Enable detailed logging (fetch, scan, generate, react, webcomponents, analyze, render)

Free vs. Pro

Specs CLI works without a license key. At the free tier, specs include full component structure: anatomy, props, variants, and raw style values.

With a Pro license, specs also include design token references, variable bindings, and visibility bindings — connecting your specs directly to your design token system.

FeatureFreePro
Anatomy, props, variantsYesYes
Layout and raw style valuesYesYes
Design token references—Yes
Variable and visibility bindings—Yes

Set up your license key in your environment to unlock Pro features. See Getting Started — environment setup and Licensing.

Output Format

The CLI generates the same specification format as the Figma Plugin:

components:
dsButton:
title: DS Button
props:
size:
type: variant
values: [small, medium, large]
variant:
type: variant
values: [primary, secondary]
anatomy:
- id: container
name: Container
type: FRAME
- id: label
name: Label
type: TEXT
variants:
- props:
size: small
variant: primary
anatomy:
container:
styles:
paddingLeft: { value: 12, type: ABSOLUTE }

File Outputs

specs fetch writes deterministic filenames based on your config aliases.

Example (with data.directory: ./data in config/settings.yaml):

data/
├── library.file.json
├── library.variables.json
├── library.styles.json
├── foundations.variables.json
└── foundations.styles.json

generate uses these files by default when data.sources in config/settings.yaml declares the corresponding aliases and fetch kinds.

Requirements

  • Node.js 18 or higher
  • Figma access token (for fetch) via FIGMA_TOKEN
  • Figma REST API data (JSON files from Figma API endpoints, produced by fetch):
    • file / styles — any Figma plan with REST API access
    • variables — Figma restricts the variables REST endpoints to organizations on an Enterprise plan, regardless of your Specs license; on any other plan, fetch variables through the plugin with --from-bridge
  • License key (optional) via SPECS_LICENSE_KEY for Pro features
  • A running CLI bridge and open Figma session (for render only) — see the Render to Figma guide

See Getting Started for installation instructions.

See Also