CLI

Use the apen-ui CLI to set up your project and add components.

init

Detects your import alias, global CSS file and package manager, then sets everything up.

pnpm dlx apen-ui@latest init
Options:
  -c, --cwd <path>       the project directory
  -y, --yes              accept the detected defaults
  -f, --force            overwrite existing config, utils and theme
  --no-install           do not install dependencies
  -r, --registry <url>   use a hosted registry instead of the bundled one

add

Adds components and everything they depend on. For example, sidebar also adds button and tooltip. Imports are rewritten to the aliases in apen.json. Files you already have are never overwritten unless you pass --overwrite. Run it with no arguments to pick from a list.

pnpm dlx apen-ui@latest add sidebar stat-card table
Options:
  -c, --cwd <path>       the project directory
  -a, --all              add every component
  -y, --yes              skip confirmation prompts
  -o, --overwrite        overwrite files that already exist
  -p, --path <path>      write components to this folder instead of the ui alias
  --no-install           do not install dependencies
  -r, --registry <url>   use a hosted registry instead of the bundled one

list

Prints every available component, grouped by category.

pnpm dlx apen-ui@latest list

apen.json

Created by init. Change the aliases here if your project keeps components somewhere else.

apen.json
{
  "$schema": "https://cdn.jsdelivr.net/npm/apen-ui@latest/schema.json",
  "tsx": true,
  "rsc": true,
  "css": "app/globals.css",
  "aliases": {
    "components": "@/components",
    "ui": "@/components/ui",
    "utils": "@/lib/utils"
  }
}

Registry

The registry ships inside the CLI, so it works offline and always matches the CLI version. This site also serves it as JSON at /r/index.json and /r/[name].json. Point the CLI at a hosted copy with --registry https://your-site.com/r or the APEN_UI_REGISTRY environment variable.