Init
Initialize config and tokens.json starting with an Open Source design system.
npx tz initSupported design systems:
- Adobe Spectrum
- Apple Human Interface Guidelines
- GitHub Primer
- IBM Carbon
- Figma Simple Design System
- Salesforce Lightning
- Shopify Polaris
- Radix
Have another one to add? Suggest it!
Build
Generate code from tokens.json based on plugins. Requires a config file.
npx tz buildBuild flags
| Name | Description |
|---|---|
--watch | -w | Rebuild whenever any token changes are detected. |
--no-lint | Ignore any lint errors while building. |
Check
Validate all DTCG tokens for syntax errors, and run any linters you’ve enabled. Can optionally specify a [path] tokens are located at (by default, will look for the tokens defined in your config file).
npx tz check [filename]Import
Terrazzo allows importing from Figma files with the import command. Automatically import Figma Styles and Variables (note that Variables require an Enterprise plan; Styles work for any plan).
npx tz import https://www.figma.com/design/xxxxxxxxxxxxxxxxxvxxx/Design-System-Variables --output my-tokens.tokens.jsonImport flags
| Name | Description |
|---|---|
--output [file], -o [file] | .tokens.json file to write to. |
--unpublished | By default, this will grab the published library in the file. If you’d like to just simply grab what the file has, unpublished or not, add --unpublished. |
Normalize
The DTCG format has gone through many iterations over the years. Terrazzo lenient in the inputs it allows, such as allowing legacy sRGB hex colors without throwing a parsing error. To quickly update your tokens to the latest version of the format, run the following command:
tz normalize <input.json> -o normalized.jsonThis will keep your tokens 100% as-authored, but will upgrade older DTCG files to the updated format and will safely fix minor issues. But just as a safety precaution, it requires saving to a new location just so you can review the changes before committing them.
| Name | Description |
|---|---|
--out | -o | Tokens file to output. |
Global flags
Flags available for any command
| Name | Description |
|---|---|
--config | -c | Path to config (default: terrazzo.config.js). |
--silent | Suppress warnings. |
--help | Show help message and exit. |
--version | Show version and exit. |