@theme-kit/cli
CLI reference
Global options
theme-kit <command> [options]
Options:
-h, --help Show help ("theme-kit <command> --help" for a command's help)
-v, --version Show the installed versionCommands
| Command | Usage | Options |
|---|---|---|
generate | theme-kit generate | --seed, --family, --mode, --output |
validate | theme-kit validate <file> | --file |
inspect | theme-kit inspect <file> | --file |
migrate | theme-kit migrate <file> | --file, --output |
export | theme-kit export <file> | --file, --format, --output |
All of validate, inspect, migrate, and export accept the theme as a
positional path instead of --file. Every command accepts a single theme or a
{ light, dark } pair.
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Command or runtime error |
2 | Invalid arguments / usage error |
3 | Validation failed (the validate command) |
CI and editors can switch on these without parsing stdout.
Output formats
export --format css—--theme-*custom properties. A pair emits:rootfor light and.dark, [data-theme="dark"]for dark.export --format json— the flat--theme-*variable map as JSON.generate— pretty-printed theme JSON (a pair by default).
Environment & non-interactive mode
The CLI never prompts, always respects --output for file writes, never
overwrites without being told to, and prints plain text. It has no
environment-variable knobs; behavior is fully driven by arguments.
Troubleshooting
theme-kit: command not found
The global npm/pnpm bin directory isn't on your PATH, or the package is not
installed globally.
1# npm: confirm the install (`-g` is npm's global flag)
2npm list -g @theme-kit/cli
3npm prefix -g
4
5# or just use npx (no global install)
6npx --yes @theme-kit/cli --helpAlternatively, install it per project (see Installation).
Cannot find theme file
Error: cannot read file pathPass a readable path, or as a positional value after the command:
theme-kit inspect themes/mint.json.
Invalid theme
When validate reports missing tokens, add the required semantic token set
(e.g. colors.background) and re-run. A theme tree whose structure is wrong
(token groups under tokens) is reported the same way.
Unknown command
Unknown command: <name>Run theme-kit --help for the list, or theme-kit <command> --help.
Node version
The CLI needs Node.js 22+. Running an older Node surfaces a loader error.