CLI
prismrepo init
Initialize Prism's configuration in your project.
npx prismrepo init [--force] [--alias <alias>] [--css <path>]What it writes
prism.json, Prism's own config (not shadcn/ui'scomponents.json): the import aliasaddrewrites templates to, where Layer 1 primitives and Layer 2 field components go, and which global CSS file received Prism's design tokens.components/prism/fields/registry.ts, a starting, emptydefineRegistry({})call, only if you don't already have one.- Prism's CSS variable tokens, appended to your detected global stylesheet, wrapped in
marker comments so re-running
initnever duplicates them. A Next.js App Router project'sapp/globals.cssis detected automatically; a few other common locations are checked too.
Flags
| Flag | Effect |
|---|---|
--force | Re-initialize even if prism.json already exists. |
--alias <alias> | Import alias installed files use (default @/components/prism). |
--css <path> | Explicit global CSS file to append Prism's tokens to, if auto-detection doesn't find one. |
Idempotency
Re-running init without --force when prism.json already exists is a no-op: it prints a
message and changes nothing. Your installed components and registry.ts are never touched by
init once they exist.
See Generated Files for the exact shape of what gets written.