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 acomponents.json configuration file that stores your project’s path aliases, Tailwind config location, and registry URL.
init does:
- Creates a
components.jsonfile at your project root - Sets component path aliases (
@/components,@/lib/utils, etc.) - Configures the RareUI registry URL
- Prompts for confirmation if
components.jsonalready exists
components.json looks like this:
components.json
add
Adds one or more components to your project. Downloads source files from the registry and installs npm dependencies.add does:
- Verifies
components.jsonexists (runinitfirst if not) - Fetches the list of available components from the registry
- Downloads the component source to
components/rareui/ - Prompts before overwriting existing files (unless
--yesor--overwrite) - Installs runtime dependencies with
npm installand@types/*packages as dev dependencies
diff
Checks installed components against the latest versions in the registry and optionally updates them.diff does:
- Scans
components/rareui/for installed.tsxand.tsfiles - Fetches the latest versions from the registry
- Compares local files line-by-line and reports additions, deletions, and modifications
- Prompts to update components that have changed
- Re-installs dependencies after updating
Options
Options are shared across commands where applicable.| Option | Commands | Description |
|---|---|---|
-y, --yes | add, diff | Skip all confirmation prompts. |
-o, --overwrite | add | Overwrite existing component files without prompting. |
-c, --cwd <path> | add, diff | Set the working directory (default: current directory). |
-p, --path <path> | add | Override the installation path for component files. |
-h, --help | all | Display help for the command. |
-V, --version | root | Print the CLI version. |
FAQ
Does the CLI work with frameworks other than Next.js?
Does the CLI work with frameworks other than Next.js?
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.
Can I use RareUI without the CLI?
Can I use RareUI without the CLI?
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.
Where are components installed?
Where are components installed?
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.What happens if a component file already exists?
What happens if a component file already exists?
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.How does diff detect changes?
How does diff detect changes?
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.Why does the CLI use npm to install dependencies even if I use pnpm or yarn?
Why does the CLI use npm to install dependencies even if I use pnpm or yarn?
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.