CLI Reference

The popcn CLI helps you initialize projects and add components.

popcn init

Initialize popcn/ui in your project. This sets up the configuration file, CSS tokens, and utility functions.

npx popcn init

Options

OptionDescription
-y, --yesSkip confirmation prompts
-d, --defaultsUse default configuration
-f, --forceForce overwrite existing files

What it does

  • Creates components.json configuration
  • Adds AuroraPop CSS tokens to your global stylesheet
  • Creates lib/utils.ts with the cn() helper
  • Sets up component and utility paths

popcn add

Add components to your project from the registry.

npx popcn add button

Adding multiple components

npx popcn add button card input badge

Options

OptionDescription
-y, --yesSkip confirmation prompts
-o, --overwriteOverwrite existing files
-p, --pathCustom path for components

components.json

The configuration file that tells the CLI where to put things.

{
  "$schema": "https://popcnui.com/schema.json",
  "style": "aurorapop",
  "theme": "cosmic",
  "tailwind": {
    "config": "tailwind.config.ts",
    "css": "app/globals.css"
  },
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils",
    "lib": "@/lib"
  }
}

Environment Variables

Override the default registry URL for development or private registries.

# Use a local development registry
POPCN_REGISTRY_URL=http://localhost:3000/api/registry npx popcn add button

# Use a custom registry
POPCN_REGISTRY_URL=https://my-registry.com/api npx popcn add button