Skip to content

@theme-kit/cli

`theme-kit export`

text
theme-kit export <file> [options]

Options

OptionDescription
--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:

bash
theme-kit export theme.json --format css --output theme.css
css
:root {
  --theme-color-background: #f8fafc;
  --theme-color-primary: #6366f1;
}

A light + dark pair exports both blocks:

css
1:root {
2  /* light */
3}
4
5.dark, [data-theme="dark"] {
6  /* dark */
7}
css
@import "./theme.css"; /* :root plus the .dark block */

JSON

bash
theme-kit export theme.json --format json

Emits 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

CodeMeaning
0Exported successfully.
2Invalid arguments (missing file or unknown format).
CLI export — Theme Kit