Skip to main content
The RareUI CLI (rareui) is the fastest way to add components to your project. It fetches component source from the registry at rareui.in/r, writes files to your components/rareui/ directory, and installs any required npm dependencies automatically.
The CLI requires Node.js 18 or later. It is published to npm as rareui (version 0.1.6+).

Commands

init

Initializes RareUI in your project. Creates a components.json configuration file that stores your project’s path aliases, Tailwind config location, and registry URL.
npx rareui@latest init
What init does:
  • Creates a components.json file at your project root
  • Sets component path aliases (@/components, @/lib/utils, etc.)
  • Configures the RareUI registry URL
  • Prompts for confirmation if components.json already exists
The generated components.json looks like this:
components.json
{
  "style": "new-york",
  "rsc": true,
  "tsx": true,
  "tailwind": {
    "config": "",
    "css": "app/globals.css",
    "baseColor": "neutral",
    "cssVariables": true,
    "prefix": ""
  },
  "iconLibrary": "lucide",
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils",
    "ui": "@/components/ui",
    "lib": "@/lib",
    "hooks": "@/hooks"
  },
  "registries": {
    "@rareui": "https://rareui.in/r/{name}.json"
  }
}

add

Adds one or more components to your project. Downloads source files from the registry and installs npm dependencies.
npx rareui@latest add [component-name]
Examples:
# Add a single component
npx rareui@latest add liquid-button

# Add multiple components at once
npx rareui@latest add particle-card soft-button

# Add all available components
npx rareui@latest add .

# List all available components (no argument)
npx rareui@latest add
Component naming: Both kebab-case and PascalCase are accepted.
npx rareui@latest add liquid-button
# same as
npx rareui@latest add LiquidButton
What add does:
  1. Verifies components.json exists (run init first if not)
  2. Fetches the list of available components from the registry
  3. Downloads the component source to components/rareui/
  4. Prompts before overwriting existing files (unless --yes or --overwrite)
  5. Installs runtime dependencies with npm install and @types/* packages as dev dependencies
add requires components.json to exist. If you see an error about a missing components.json, run npx rareui@latest init first.

diff

Checks installed components against the latest versions in the registry and optionally updates them.
npx rareui@latest diff
Examples:
# Check all installed components
npx rareui@latest diff

# Check a specific component
npx rareui@latest diff liquid-button

# Update all components without a confirmation prompt
npx rareui@latest diff --yes
What diff does:
  1. Scans components/rareui/ for installed .tsx and .ts files
  2. Fetches the latest versions from the registry
  3. Compares local files line-by-line and reports additions, deletions, and modifications
  4. Prompts to update components that have changed
  5. Re-installs dependencies after updating

Options

Options are shared across commands where applicable.
OptionCommandsDescription
-y, --yesadd, diffSkip all confirmation prompts.
-o, --overwriteaddOverwrite existing component files without prompting.
-c, --cwd <path>add, diffSet the working directory (default: current directory).
-p, --path <path>addOverride the installation path for component files.
-h, --helpallDisplay help for the command.
-V, --versionrootPrint the CLI version.

FAQ

Currently the CLI is optimized for React projects using Next.js and Tailwind CSS. The component registry and file paths assume an App Router project structure. Support for other frameworks (Vite, Remix, etc.) is planned.
Yes. The CLI is purely for convenience. Every component’s source code is available in the documentation — copy it, paste it into your project, and install any listed dependencies manually. See the Quickstart for a manual walkthrough.
Components are written to components/rareui/ relative to your working directory (or the path passed with --path). For example, liquid-button is installed as components/rareui/LiquidButton.tsx.
The CLI checks for existing files before writing. If conflicts are found, it prompts you to confirm before overwriting. Use --overwrite to skip the prompt and always overwrite, or --yes to accept all prompts automatically.
diff does a line-by-line comparison between your local file and the registry version. It reports the number of additions, deletions, and changed lines per file. If the files are identical, no update is offered.
The current version of the add command uses npm install internally for dependency installation. If you use a different package manager, you can install dependencies manually after running add. This behavior will be improved in a future release.

Build docs developers (and LLMs) love