CLI Reference
Complete reference for the Prototyper UI CLI — init, add, search, update, browse, diff, inspect, props, suggest, audit, scaffold, migrate, registry, theme, mcp, doctor, and machine-mode commands.
The Prototyper UI CLI (@prototyperco/cli) is your gateway into the ecosystem — components, registries, AI skills, themes, and more.
bunx @prototyperco/cli <command> [options]The CLI is built on Bun for the best experience. Running without a subcommand opens the full-screen terminal app with mouse support, component browser, and health dashboard.
Note: The CLI also works via
npxunder Node.js, but the interactive terminal app requires Bun.
create
Scaffold a brand new project with Prototyper UI pre-configured.
npx @prototyperco/cli create my-appWhat it does
- Runs
create-next-appwith TypeScript, Tailwind, ESLint, App Router, and src directory - Runs
initinside the new project (tokens, utils, config) - Installs starter components: button, input, card, dialog, field
- Runs a single
installat the end
Options
| Flag | Description |
|---|---|
--template <name> | Project template (nextjs, vite, remix, astro — default: nextjs) |
--demo | Include a demo page showcasing the starter components |
Example
# Default Next.js project
npx @prototyperco/cli create my-app --demo
cd my-app
pnpm dev
# Vite project
npx @prototyperco/cli create my-app --template vite
# Remix project
npx @prototyperco/cli create my-app --template remix
# Astro project
npx @prototyperco/cli create my-app --template astroinit
Add design tokens, utilities, and base styles to your project.
npx @prototyperco/cli initWhat it does
- Finds your
globals.css(checksapp/globals.css,src/app/globals.css,styles/globals.css,src/styles/globals.css) - Merges OKLCH design tokens into it (or replaces existing tokens)
- Creates
lib/utils.tswith thecn()utility (clsx + tailwind-merge) - Writes a
.prototyper-ui.jsonmanifest with your project config - Optionally installs AI skills for Claude Code or Cursor
Options
| Flag | Description |
|---|---|
--css <path> | Path to your globals.css file (skips auto-detection) |
--force | Skip confirmation prompts |
--dry-run | Preview changes without writing files |
--skills | Install Claude Code / Cursor skills |
--no-skills | Skip skills installation |
--compose | Scaffold Compose integration files |
--json | Output JSON (for LLM-driven setup) |
Examples
# Standard setup
npx @prototyperco/cli init
# Custom CSS path
npx @prototyperco/cli init --css src/styles/globals.css
# Non-interactive with Compose
npx @prototyperco/cli init --force --compose
# Preview what would change
npx @prototyperco/cli init --dry-runadd
Add components or integrations to your project.
npx @prototyperco/cli add [components...]Behavior
- With arguments: installs the named components and their dependencies
- Without arguments: opens an interactive picker (grouped by category)
- With
--all: installs every available component
Components are written to components/ui/ (or src/components/ui/ if a src/ directory exists). Use --dir to override.
Options
| Flag | Description |
|---|---|
--dir <path> | Components directory (default: components/ or src/components/) |
--all | Install all available components |
--force | Overwrite existing files without asking |
--dry-run | Preview changes without writing files |
--no-install | Skip automatic dependency installation |
--provider <provider> | AI provider for compose scaffold (anthropic or openai) |
--json | Output JSON (for LLM-driven setup) |
Examples
# Add a single component
npx @prototyperco/cli add button
# Add multiple components
npx @prototyperco/cli add button card dialog select text-field
# Add a component from another registry
npx @prototyperco/cli add @acme/fancy-card
# Interactive picker
npx @prototyperco/cli add
# Install everything
npx @prototyperco/cli add --all
# Preview without writing
npx @prototyperco/cli add button --dry-run
# Scaffold Compose endpoint
npx @prototyperco/cli add compose --provider anthropicDependency resolution
When you install a component, the CLI automatically resolves and installs any registry dependencies. For example, text-field depends on field — both will be installed.
After writing files, the CLI prompts to install npm dependencies (like @base-ui/react) unless --no-install is passed.
update
Check installed components for updates and apply them.
npx @prototyperco/cli updateBehavior
- Scans your
components/ui/directory for installed.tsxfiles - Fetches the latest version of each from the registry
- Compares local content against the registry version
- Prompts to update each changed component (or updates all with
--force)
Options
| Flag | Description |
|---|---|
--dir <path> | Components directory |
--force | Update all without prompting |
--dry-run | Preview changes without writing |
--json | Output JSON |
Examples
# Interactive update
npx @prototyperco/cli update
# Update all without prompting
npx @prototyperco/cli update --force
# Check what would change
npx @prototyperco/cli update --dry-runNote: If you've customized a component, updating will overwrite your changes. Use
--dry-runfirst to see what would change.
search
Search for components across registries by name or description.
npx @prototyperco/cli search [query...]Behavior
- Fuzzy matches against component name and description
- Shows name, description, category, registry, and an installed marker for components already in your project
- By default, searches your configured registries. Use
--allto search all known registries.
Options
| Flag | Description |
|---|---|
--all | Search all known registries, not just configured ones |
--json | Output JSON |
Examples
# Search for button components
npx @prototyperco/cli search button
# Search a specific registry
npx @prototyperco/cli search @acme button
# Search all registries
npx @prototyperco/cli search --all buttondoctor
Check your project health and configuration.
npx @prototyperco/cli doctorChecks
The doctor command verifies:
| Check | What it verifies |
|---|---|
globals.css | CSS file exists and is found |
Tailwind v4 | @import "tailwindcss" is present |
Tokens | Prototyper UI token block is installed |
lib/utils.ts | Utility file exists |
Dependencies | @base-ui/react, clsx, tailwind-merge, class-variance-authority are in package.json |
Components | Count of installed components (info only) |
Options
| Flag | Description |
|---|---|
--json | Output JSON |
Example
npx @prototyperco/cli doctor ✓ Found globals.css at app/globals.css
✓ Tailwind v4 detected
✓ Tokens installed
✓ lib/utils.ts exists
✓ All peer dependencies installed
ℹ 12 components installed
4 of 5 checks passedbrowse
Interactive component catalog browser. Opens a full-screen TUI with a component list and detail panel.
npx @prototyperco/cli browseExample
npx @prototyperco/cli browsediff
Show differences between your local components and the latest registry versions.
npx @prototyperco/cli diff [components...]Behavior
- With arguments: diffs only the named components
- Without arguments: diffs all installed components
Options
| Flag | Description |
|---|---|
--dir <path> | Components directory |
--json | Output JSON |
Example
# Diff all installed components
npx @prototyperco/cli diff
# Diff specific components
npx @prototyperco/cli diff button dialoginspect
Deep analysis of a single component — variants, props, tokens, Base UI primitive, exports, and reverse dependencies.
npx @prototyperco/cli inspect <component>Options
| Flag | Description |
|---|---|
--json | Output JSON |
Example
npx @prototyperco/cli inspect buttonButton
Category: actions
Base UI: @base-ui/react — Button
Variants: variant (solid, outline, ghost, link), size (sm, md, lg)
Exports: Button
Used by: alert-dialog, dialog, formprops
Quick reference for a component's props, variants, events, and import path.
npx @prototyperco/cli props <components...>Options
| Flag | Description |
|---|---|
--json | Output structured JSON |
Example
# Single component
npx @prototyperco/cli props button
# Multiple components
npx @prototyperco/cli props button select dialogsuggest
Scan your source code for raw HTML patterns that could be replaced with Prototyper UI components.
npx @prototyperco/cli suggestBehavior
Scans files in src/ for common patterns (e.g. <button>, <input>, <dialog>) and suggests matching Prototyper UI components.
Options
| Flag | Description |
|---|---|
--json | Output JSON |
Example
npx @prototyperco/cli suggestaudit
Scan page or component files and check which Prototyper UI imports are installed. Optionally auto-install missing components.
npx @prototyperco/cli audit <files...>Options
| Flag | Description |
|---|---|
--fix | Auto-install missing components |
--json | Output structured JSON results |
Example
# Audit a page file
npx @prototyperco/cli audit app/settings/page.tsx
# Audit and auto-fix
npx @prototyperco/cli audit app/settings/page.tsx --fixscaffold
Scaffold a full page from a template with pre-selected Prototyper UI components.
npx @prototyperco/cli scaffold [template]Templates
| Template | Description |
|---|---|
form-page | Form page with validation and field components |
dashboard | Dashboard layout with cards and data display |
settings | Settings page with grouped form sections |
Options
| Flag | Description |
|---|---|
--output <path> | Custom output path for the page file |
--json | Output JSON |
Example
# Interactive template picker
npx @prototyperco/cli scaffold
# Scaffold a specific template
npx @prototyperco/cli scaffold form-page
# Custom output path
npx @prototyperco/cli scaffold dashboard --output app/dashboard/page.tsxmigrate
Run automated transforms on installed components.
npx @prototyperco/cli migrate <transform>Transforms
| Transform | Description |
|---|---|
icons | Switch icon library on installed components |
rtl | Map physical CSS properties to logical (ml- to ms-, text-left to text-start) |
prefix | Add Tailwind prefix to all utility classes |
css-vars | Map hardcoded Tailwind colors to token classes |
Options
| Flag | Description |
|---|---|
--force | Apply transform without prompting |
--dry-run | Preview changes without writing files |
--json | Output JSON |
Examples
# Switch to a different icon library
npx @prototyperco/cli migrate icons
# Preview RTL migration
npx @prototyperco/cli migrate rtl --dry-run
# Add Tailwind prefix to all components
npx @prototyperco/cli migrate prefix --force
# Convert hardcoded colors to CSS tokens
npx @prototyperco/cli migrate css-varsregistry
Manage component registries and create your own.
registry add / remove / list
Configure which registries you install components from.
npx @prototyperco/cli registry add <alias>=<url>
npx @prototyperco/cli registry remove <alias>
npx @prototyperco/cli registry listOptions for registry add
| Flag | Description |
|---|---|
--header <key>=<value> | Add an authorization header for private registries |
Examples
# Add a third-party registry
npx @prototyperco/cli registry add @acme=https://registry.acme.com/r/{name}.json
# Add a private registry with auth
npx @prototyperco/cli registry add @acme=https://registry.acme.com/r/{name}.json --header "Authorization=Bearer ${TOKEN}"
# Remove a registry
npx @prototyperco/cli registry remove @acme
# List configured registries
npx @prototyperco/cli registry listregistry init / validate / build
Create and publish your own component registry.
npx @prototyperco/cli registry init
npx @prototyperco/cli registry validate [registry.json]
npx @prototyperco/cli registry build [registry.json] --output public/rExamples
# Initialize a new registry manifest
npx @prototyperco/cli registry init
# Validate a registry manifest
npx @prototyperco/cli registry validate
# Validate a specific file
npx @prototyperco/cli registry validate custom-registry.json
# Build registry JSON files for distribution
npx @prototyperco/cli registry build --output public/rexport:context
Generate a single AI context file containing your project's installed components, theme, and structure.
npx @prototyperco/cli export:contextOptions
| Flag | Description |
|---|---|
--output <path> | Write to a file instead of stdout |
--json | Output structured JSON |
--clipboard | Copy to clipboard (macOS) |
Example
# Print to stdout
npx @prototyperco/cli export:context
# Write to file
npx @prototyperco/cli export:context --output context.md
# Copy to clipboard
npx @prototyperco/cli export:context --clipboardtheme export
Generate OKLCH CSS tokens from theme parameters.
npx @prototyperco/cli theme exportOptions
| Flag | Description |
|---|---|
--output <path> | Write tokens to a CSS file (e.g. app/globals.css) |
--json | Output JSON with params and CSS |
Example
# Print tokens to stdout
npx @prototyperco/cli theme export
# Write to globals.css
npx @prototyperco/cli theme export --output app/globals.cssmcp init
Auto-configure the Prototyper UI MCP server in Claude Code, Cursor, and VS Code.
npx @prototyperco/cli mcp initOptions
| Flag | Description |
|---|---|
--json | Output JSON |
Example
npx @prototyperco/cli mcp initmachine-mode init
Scaffold machine mode for a Next.js App Router project. Machine mode provides URL-driven endpoints for programmatic component rendering.
npx @prototyperco/cli machine-mode initOptions
| Flag | Description |
|---|---|
--dir <path> | Project directory (default: current directory) |
--machine-base-path <path> | Base route path for machine endpoints (default: machine) |
--force | Skip confirmation prompts |
--dry-run | Preview changes without writing files |
--json | Output JSON (for LLM-driven setup) |
See the Machine Mode guide for full documentation.
JSON mode
Every command supports a --json flag that outputs structured JSON instead of interactive prompts. This is designed for LLM-driven workflows where an AI agent runs CLI commands programmatically.
# List available components as JSON
npx @prototyperco/cli add --json
# Install and get structured result
npx @prototyperco/cli add button --json
# Check project health as JSON
npx @prototyperco/cli doctor --jsonConfiguration
.prototyper-ui.json
The init command creates a .prototyper-ui.json manifest in your project root:
{
"version": "0.1.2",
"css": "app/globals.css",
"componentsDir": "components",
"iconLibrary": "lucide",
"preset": "default",
"tailwind": {
"prefix": ""
},
"registries": {
"@prototyper": "https://prototyper-ui.com/r/{name}.json"
},
"endpoints": {
"docs": "https://prototyper-ui.com/docs",
"llms": "https://prototyper-ui.com/llms.txt",
"components": "https://prototyper-ui.com/llms-components.txt"
}
}| Field | Description |
|---|---|
version | CLI version that created the manifest |
css | Relative path to your globals.css file |
componentsDir | Base directory for component installation |
iconLibrary | Icon library used in components (lucide, tabler, phosphor, heroicons, remix) |
preset | Design preset name |
tailwind.prefix | Custom Tailwind prefix applied to all utility classes |
registries | Map of registry aliases to URL templates for multi-registry support |
endpoints | Registry and documentation URLs |
Package manager detection
The CLI auto-detects your package manager by checking for lock files in the current directory:
| Lock file | Package manager |
|---|---|
pnpm-lock.yaml | pnpm |
yarn.lock | yarn |
bun.lockb | bun |
package-lock.json | npm |
The detected package manager is used for dependency installation commands.
Using with shadcn CLI
Prototyper UI components are compatible with the shadcn CLI. You can install any component directly:
npx shadcn@latest add https://prototyper-ui.com/r/button.jsonThis works because Prototyper UI publishes registry JSON at prototyper-ui.com/r/{component}.json in the shadcn registry format.