✦ Asteria UI

CLI

init, add, and how the registry works.

The CLI fetches component JSON from the registry URL and copies source into your project. Default registry: https://asteria-ui.com/r.

Commands

npx asteria-ui init            # write tokens, theme mapping, cn(), install deps
npx asteria-ui add button      # copy one or more components into your project
npx asteria-ui add button modal tabs

# Local docs server during development:
ASTERIA_REGISTRY_URL=http://localhost:3000/r npx asteria-ui add button

init

Fetches styles.json and cn.json from the registry, writes the token CSS, Tailwind v4 @theme mapping, and cn() helper, then installs clsx, tailwind-merge, and class-variance-authority. Safe to re-run; existing files are skipped unless you pass --force.

add

Fetches {registry}/{name}.json, resolves registryDependencies, and copies file contents into your configured components directory. Dependencies listed on the registry item are installed automatically. Multi-name adds resolve shared deps once.

Registry

Components are served as JSON from asteria-ui.com/r/[name].json, following the shadcn registry schema. That means any shadcn-compatible tooling can consume Asteria components directly.

components.json includes a registry field (overridable with ASTERIA_REGISTRY_URL). Rebuild the hosted JSON after changing components:

pnpm build:registry

registry.json shape

{
  "$schema": "https://ui.shadcn.com/schema/registry.json",
  "name": "asteria-ui",
  "homepage": "https://asteria-ui.com",
  "items": [
    {
      "name": "button",
      "type": "registry:ui",
      "title": "Button",
      "description": "Interactive button for actions and form submissions.",
      "dependencies": ["class-variance-authority", "clsx", "tailwind-merge"],
      "files": [
        { "path": "ui/button/button.tsx", "type": "registry:ui" },
        { "path": "lib/cn.ts", "type": "registry:lib" }
      ]
    }
  ]
}

Each item names the files to copy and the npm packages they need. The monorepo source of truth lives in packages/registry.