@theme-kit/cli
CI & Automation
Run everywhere
theme-kit (installed) or npx --yes @theme-kit/cli behaves the same on npm,
pnpm, yarn, bun, cmd, PowerShell, bash, and zsh. Prefer a project-local
install in CI so the version is locked and reviewed:
{
"scripts": {
"theme:validate": "theme-kit validate themes/"
}
}Exit codes make it a gate
validate fails with a nonzero exit code, so an invalid theme stops the
pipeline:
| Code | Meaning |
|---|---|
0 | Success |
1 | Command/runtime error |
2 | Invalid arguments |
3 | Validation failed |
theme-kit validate themes/
if [ $? -ne 0 ]; then
echo "theme invalid — rejecting"
exit 1
fiGitHub Actions
1name: Validate Themes
2
3on:
4 pull_request:
5 push:
6 branches: [main]
7
8jobs:
9 themes:
10 runs-on: ubuntu-latest
11 steps:
12 - uses: actions/checkout@v4
13 - uses: pnpm/action-setup@v4
14 - uses: actions/setup-node@v4
15 with:
16 node-version: 22
17 - run: pnpm install --frozen-lockfile
18 - run: pnpm exec theme-kit validate themes/Automation-friendly behaviours
- No prompts. The CLI never asks for input.
- File writes are explicit. Only
--outputwrites; the default is stdout. - Deterministic per project. A script in
package.jsonfixes the version, so machines agree. - Pre-build step. Run
theme:generatebeforenext build,vite build, or a Tailwind pass sotheme.json/theme.cssexist first.
Next: Reference.