@prismforge/token-cli
v0.8.0
Published
CLI for validating, building, and exporting PrismForge tokens.
Readme
PrismForge CLI
Commands:
prismforge init [--mode <standalone|embedded>] [--layout <workspace|app-first>] [--embedded-path <path>] [--tokens-path <path>] [--studio-name <name>] [--dir <path>] [--provider <github|gitlab|bitbucket|generic>] [--repository <id-or-url>] [--base-branch <name>] [--targets <css,js,android,ios|all>] [--studio <true|false>] [--package-manager <pnpm|npm>] [--prompt] [--yes] [--install]prismforge brand add --brand <id> [--modes <light,dark>] [--from <brand>] [--tokens-root <path>] [--force]prismforge validateprismforge build --brand <id> --mode <id> --target <css|js|android|ios|all>prismforge diff --from <snapshot> --to <snapshot>prismforge release --channel <stable|next|alpha|beta|rc|canary|custom> [--dist-tag <tag>]prismforge figma export --brand <id> --mode <id>
Scaffold a self-hosted Token Studio
Interactive wizard:
npx @prismforge/token-cli initNon-interactive:
npx @prismforge/token-cli init \
--dir prismforge-studio \
--studio-name "Acme Token Studio" \
--provider github \
--repository your-org/your-token-repo \
--base-branch main \
--targets css,js,ios \
--studio trueNotes:
- If run inside an existing git repo,
initauto-detects provider/repository fromorigin. --repositoryis optional. Leave it empty for new workspaces and set it later in.env.local.- Package manager is auto-detected (
npmorpnpm) and can be forced with--package-manager. --studio-namecustomizes the Token Studio header/title (default:PrismForge Token Studio).
Embedded mode (inside existing repo)
npx @prismforge/token-cli init \
--mode embedded \
--layout app-first \
--embedded-path tools/prismforge \
--tokens-path design-tokens \
--package-manager npmThis keeps PrismForge inside your current project and adds helper scripts to your root package.json:
prismforge:installprismforge:devprismforge:buildprismforge:test
Layout notes:
app-first(default for embedded): token source lives at project root (design-tokens/by default).--tokens-pathlets you move token source anywhere in your host repo (for exampletokens/design).workspace: token source stays intools/prismforge/packages/token-source.
Then run:
# from host project root
npm run prismforge:install
# copy tools/prismforge/apps/token-studio/.env.example to .env.local (inside tools/prismforge/apps/token-studio)
npm run prismforge:devTokens-only scaffold (no Studio UI)
npx @prismforge/token-cli init \
--dir prismforge-tokens \
--targets ios \
--studio falseAdd your own brand
npx @prismforge/token-cli brand add \
--brand acme-enterprise \
--modes light,dark \
--from acmeThis creates semantic/component files for your brand in the detected token source root (design-tokens/src/tokens or packages/token-source/src/tokens).
