@theme-kit/cli
v1.3.0
Published
Theme Kit CLI: generate, validate, inspect, and migrate themes.
Maintainers
Readme
@theme-kit/cli
The theme-kit command-line toolkit for Theme Kit — generate, validate,
migrate, inspect, and export themes from any shell, for any framework.
It wraps the @theme-kit/core
design system into plain shell commands. It reads and writes the same JSON
theme files that every @theme-kit/* framework package consumes.
Requirements
- Node.js 22+ (any modern release). No browser package is needed.
Install
Global (any directory)
# npm — `-g` is npm's global-install flag
npm install -g @theme-kit/cli
# pnpm uses the long `--global` form
pnpm add --global @theme-kit/cli
# yarn says it differently
yarn global add @theme-kit/cliAfter a global install, theme-kit is on your PATH. The packager writes a
small shim for every platform, so it works from Windows cmd, PowerShell,
macOS Terminal, and Linux bash.
Zero install (npx)
npm, pnpm, yarn, and bun all resolve the same package:
npx --yes @theme-kit/cli generate --seed "#6366f1"One project (best for teams)
{
"scripts": {
"theme:generate": "theme-kit generate --seed \"#6366f1\" --family indigo --output theme.json"
},
"dependencies": {
"@theme-kit/cli": "^0.0.1"
}
}npm run theme:generateUsage
theme-kit <command> [options]
Commands:
generate Generate a theme from a seed color (--seed, --family, --mode, --output)
validate Validate a theme JSON file
migrate Migrate a theme to the latest format
inspect Inspect a theme's details
export Export a theme to CSS or JSON (--format css|json)Run theme-kit <command> --help for command-specific options.
A theme file is either a pair (
{ "light": …, "dark": … }, generated by default) or a single theme ({ "name", "meta", "tokens" }, from--mode light|dark). Every command accepts either shape.
The full workflow
theme-kit generate --seed "#0ea5e9" --family sky --output theme.json
theme-kit validate theme.json
theme-kit inspect theme.json
theme-kit export theme.json --format css --output theme.css
theme-kit migrate theme.jsonExit codes
| Code | Meaning |
| --- | --- |
| 0 | Success |
| 1 | Runtime or command error |
| 2 | Invalid arguments / usage error |
| 3 | Validation failed (validate) |
Development
# Build dist/cli + dist/index (ESM + CJS)
pnpm build
# Watch-mode rebuild while developing src/
pnpm devThe package ships dist/ (the built theme-kit binary and library), README.md,
and LICENSE.
License
MIT
Documentation
Full API reference and guides: Theme Kit docs. All packages: npm.
