npx @figmavars/cli build variables.jsonThe command writes a design-token pipeline:
design-tokens/
βββ tokens/
β βββ primitives.tokens.json
β βββ semantic.tokens.json
β βββ semantic.dark.tokens.json
β βββ tokens.resolver.json
βββ css/
β βββ tokens.css
β βββ tokens.tailwind.css
βββ ts/tokens.ts
βββ style-dictionary.config.mjs
βββ design-tokens.workflow.yml
βββ README.md
The token output follows DTCG 2025.10 plus a documented boolean extension.
Aliases remain token references. Figma modes become Resolver contexts. Figma
IDs, scopes, and code syntax live under $extensions['com.figma-vars'].
Create variables.json with a variables plugin that exports local Figma
variables. The FigmaVars Export workspace app supports local development.
Teams with Enterprise access can use figma-vars export against the Variables
REST API.
| Package | Purpose |
|---|---|
@figmavars/core |
Normalize exports, resolve aliases, compare revisions, and call the API |
@figmavars/dtcg |
Convert exports to token files and emit CSS, Tailwind, and TypeScript |
@figmavars/cli |
Build, compare, check, scaffold, and export token projects |
@figmavars/hooks |
Read built tokens in React or use the Variables REST API with SWR |
@figmavars/mcp |
Serve token lookups and export comparisons through MCP |
apps/figma-plugin |
Export local Figma variables to variables.json |
figma-vars diff matches variables by stable Figma IDs. A renamed variable
keeps its identity in the report:
figma-vars diff backup/variables.json variables.json --fail-on-breakingVariables: 1 renamed, 1 value change.
**Breaking changes detected.**
### Renamed variables (breaking)
- `color/bg/brand` -> `color/bg/primary` (Semantic)
| Variable | Collection | Mode | Before | After |
| ---------------- | ---------- | ------- | ------ | ----- |
| `control/height` | Density | Compact | 32 | 28 |--fail-on-breaking exits with code 2 when the report contains removals,
renames, moves, or type changes.
import { TokensProvider, useTheme, useToken } from '@figmavars/hooks'
function Brand() {
const brand = useToken('semantic.color.bg.brand')
const { setContext } = useTheme()
return (
<button
style={{ background: brand.css ?? undefined }}
onClick={() => setContext('semantic', 'dark')}>
Use dark tokens
</button>
)
}The local-token hooks read built artifacts. They do not need a Figma Personal Access Token or a network request. The package also includes live API hooks for Enterprise teams.
{
"mcpServers": {
"design-tokens": {
"command": "npx",
"args": ["-y", "@figmavars/mcp", "--tokens", "./variables.json"]
}
}
}The server provides list_collections, get_token, resolve_context,
search_tokens, and diff_tokens.
Read the documentation at figmavars.com.
Run the site from the monorepo:
pnpm --filter figmavars-docs devapps/
βββ docs/ Documentation site and browser playground
βββ figma-plugin/ Figma export plugin
βββ playground/ Standalone browser playground
packages/
βββ core/ Shared normalization, diff, API, and types
βββ dtcg/ Token conversion and emitters
βββ cli/ Command-line package
βββ hooks/ React package
βββ mcp/ MCP package
βββ plugin-export/ Private serializer used by the Figma plugin
docs/ Release notes, launch drafts, and maintainer docs
- Node.js 24 or newer
- pnpm 11 or newer for monorepo work
- React
^19.0.0and SWR^2.3.7for@figmavars/hooks
pnpm install
pnpm build
pnpm test
pnpm typecheck
pnpm lint
pnpm format:check
pnpm check:releaseSee CONTRIBUTING.md for repository setup and release checks.
MIT Β© Mark Learst