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 initOptions
| Option | Description |
|---|---|
| -y, --yes | Skip confirmation prompts |
| -d, --defaults | Use default configuration |
| -f, --force | Force overwrite existing files |
What it does
- Creates
components.jsonconfiguration - Adds AuroraPop CSS tokens to your global stylesheet
- Creates
lib/utils.tswith the cn() helper - Sets up component and utility paths
popcn add
Add components to your project from the registry.
npx popcn add buttonAdding multiple components
npx popcn add button card input badgeOptions
| Option | Description |
|---|---|
| -y, --yes | Skip confirmation prompts |
| -o, --overwrite | Overwrite existing files |
| -p, --path | Custom 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