bearnie

CLI

Add components to your project from the command line.

Initialize your project

npx bearnie init
npx bearnie init

Sets up the cn utility, path aliases, and theme variables. Run this once before adding components to an existing Astro project.

Projects created with create-bearnie already include a bearnie.json config at the project root and can skip init.

Add components

npx bearnie add button
npx bearnie add button

Add multiple components at once:

npx bearnie add button card dialog tabs
npx bearnie add button card dialog tabs

Add everything:

npx bearnie add --all
npx bearnie add --all

Components are copied to src/components/bearnie/. Required utilities go to src/utils/.

Interactive components (like popover, command, and combobox) also install shared runtime files in src/utils/runtime/ automatically. No additional loader setup is required.

You own the code.

Barrel export

After adding components, install the barrel for named imports from @/components/bearnie:

npx bearnie add barrel
npx bearnie add barrel
---
import { Button, Card } from "@/components/bearnie";
---

The barrel re-exports all installed components. Add it last, once the components you need are in place. Projects created with create-bearnie --full include it automatically.

List available components

npx bearnie list
npx bearnie list

Shows all components grouped by category, including Theme (styles) and Meta (barrel). Use --json for machine-readable output.

Options

Flag Description
-y, --yes Skip prompts, overwrite existing files
-a, --all Add all components
--cwd <path> Set working directory
--json Output as JSON (list command)