@theme-kit/cli
`theme-kit export`
theme-kit export <file> [options]Options
| Option | Description |
|---|---|
--file <path> | Theme file to export (or pass positionally). |
--format <fmt> | css or json. Defaults to css. |
--output <file> | Write the export to a file instead of stdout. |
CSS variables
A single theme:
theme-kit export theme.json --format css --output theme.css:root {
--theme-color-background: #f8fafc;
--theme-color-primary: #6366f1;
}A light + dark pair exports both blocks:
1:root {
2 /* light */
3}
4
5.dark, [data-theme="dark"] {
6 /* dark */
7}@import "./theme.css"; /* :root plus the .dark block */JSON
theme-kit export theme.json --format jsonEmits the flat --theme-* key/value map as JSON — useful for editors, scripts,
or configuration systems that consume token maps.
Default output
Omit --output to print the CSS (or JSON) to stdout.
Exit codes
| Code | Meaning |
|---|---|
0 | Exported successfully. |
2 | Invalid arguments (missing file or unknown format). |