CLI
The engine on your laptop or in CI, with no account.
The basemode command is the same engine the hosted product runs, published on PyPI as basemode-tokens. It needs no account.
uvx --from basemode-tokens basemode --help
# or: pip install basemode-tokens
Generate from Figma
FIGMA_TOKEN=… basemode generate --file KEY --format css --format swift --out src/tokens
--file takes a Figma file key and can be repeated. Reading variables through Figma's API needs Figma Enterprise; on other plans, export from the plugin and use --input.
Generate from a file
basemode generate --input tokens.json --format tailwind4 --out src/tokens
--input reads a Basemode plugin export, a W3C DTCG file or a Tokens Studio export.
Pull from Basemode
BASEMODE_KEY=… basemode pull --format typescript --out src/tokens
The latest tokens published to your design system. This is how a team without Figma Enterprise gets variables into CI: the plugin publishes, pull collects.
Options for generate and pull
| Flag | Default | What it does |
|---|---|---|
--format | css | Repeat for several. See formats. |
--out | tokens | Folder to write to |
--color | hex | hex, rgb, hsl or oklch |
--unit | px | px, rem or em |
--prefix | none | Put in front of every token's name |
--check | off | Change nothing; exit 1 if the files are out of date. For CI. |
--rename-references | off | Update code under the current folder that uses renamed tokens |
--summary FILE | none | Write a pull request title and body to FILE |
Lint
basemode lint src --tokens src/tokens/basemode.lock.json
Finds hard-coded colors, spacing, radii and font sizes that should be tokens, and exits 1 if there are any. See lint and adoption.
MCP
basemode mcp --tokens src/tokens/basemode.lock.json
Serves the design system to a coding assistant. See MCP.