Skip to Content
Prism UI
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's components.json): the import alias add rewrites 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, empty defineRegistry({}) 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 init never duplicates them. A Next.js App Router project's app/globals.css is detected automatically; a few other common locations are checked too.

Flags

FlagEffect
--forceRe-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.

On this page