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.

Pick a theme

During init (and create-bearnie) you choose two things, both from Tailwind’s official palette:

  • Base color — the grays used for backgrounds, text, and borders: neutral, slate, gray, zinc, stone, mauve, olive, mist, or taupe
  • Accent color — the primary used for buttons, focus rings, and active states: a neutral default or any Tailwind color (red, rose, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink)

Your choice is saved as a single theme name in bearnie.jsonblue, slate, slate-blue, and so on. Every combination installs the same bearnie.css file, so all components work with all themes.

Switch anytime:

npx bearnie add styles-slate-blue --overwrite
npx bearnie add styles-slate-blue --overwrite

Switching updates bearnie.json, so diff and update keep comparing against the palette you actually use.

Keep components up to date

Components are copied into your project, so they don’t change until you say so. See what differs from the registry:

npx bearnie diff
npx bearnie diff

Prints a colored per-file diff for every installed component that drifted — whether from your own edits or from registry improvements. Use --name-only for a compact summary, or pass component names to check just those.

Pull the latest registry versions:

npx bearnie update
npx bearnie update

Shows what will change, warns when you have local edits, and asks before writing. Any new npm dependencies are installed with your package manager. Use --yes to skip the confirmation.

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
-o, --overwrite Overwrite existing files (add command)
-a, --all Add all components
--name-only Only list changed files (diff command)
--cwd <path> Set working directory
--json Output as JSON (list command)