CLI
Use the CLI to add components to your project.
The RareUI CLI is the fastest way to add components to your project. It handles dependencies, configuration, and placement for you.
Init
Run the init command to initialize RareUI in your project. This will create a components.json file and configure your project for the best experience.
npx rareui@latest initpnpm dlx rareui@latest inityarn dlx rareui@latest initbunx rareui@latest init💡 Which command should I use?
Use the package manager you already have installed! Most users have npm (comes with Node.js).
Not sure which you have? Run these in your terminal:
npm --version # ✅ Most common (comes with Node.js)
pnpm --version # Fast alternative
yarn --version # Classic choice
bun --version # Fastest runtimeIf you get a "command not found" error, that package manager isn't installed. Just use npm - it's installed by default with Node.js!
Common Error: pnpm is not recognized → Use npm instead:
npx rareui@latest initAdd
Use the add command to add components to your project. This command downloads the component code and places it in your components directory, installing any necessary dependencies automatically.
npx rareui@latest add [component]pnpm dlx rareui@latest add [component]yarn dlx rareui@latest add [component]bunx rareui@latest add [component]Examples
Add a single component (supports both PascalCase and kebab-case):
npx rareui@latest add particle-card
npx rareui@latest add LiquidButtonpnpm dlx rareui@latest add particle-card
pnpm dlx rareui@latest add LiquidButtonyarn dlx rareui@latest add particle-card
yarn dlx rareui@latest add LiquidButtonbunx rareui@latest add particle-card
bunx rareui@latest add LiquidButtonAdd multiple components at once:
npx rareui@latest add particle-card liquid-button soft-buttonpnpm dlx rareui@latest add particle-card liquid-button soft-buttonyarn dlx rareui@latest add particle-card liquid-button soft-buttonbunx rareui@latest add particle-card liquid-button soft-buttonInstall all available components:
npx rareui@latest add .pnpm dlx rareui@latest add .yarn dlx rareui@latest add .bunx rareui@latest add .View the list of available components:
npx rareui@latest addpnpm dlx rareui@latest addyarn dlx rareui@latest addbunx rareui@latest addDiff
Check for updates to your installed components and update them if needed.
npx rareui@latest diffpnpm dlx rareui@latest diffyarn dlx rareui@latest diffbunx rareui@latest diffExamples
Check a specific component:
npx rareui@latest diff liquid-buttonpnpm dlx rareui@latest diff liquid-buttonyarn dlx rareui@latest diff liquid-buttonbunx rareui@latest diff liquid-buttonUpdate without confirmation:
npx rareui@latest diff -ypnpm dlx rareui@latest diff -yyarn dlx rareui@latest diff -ybunx rareui@latest diff -yOptions
| Option | Description |
|---|---|
-y, --yes | Skip confirmation prompt. |
-o, --overwrite | Overwrite existing files. |
-c, --cwd <cwd> | The working directory. |
-p, --path <path> | The path to install the component to. |
-h, --help | Display help for command. |
FAQ
Does it work with other frameworks?
Currently, the CLI is optimized for Next.js and React projects using Tailwind CSS. Support for other frameworks is planned.
Can I use it without the CLI?
Yes! You can manually copy and paste the code from the documentation into your project. The CLI just automates this process.
Can I use both kebab-case and PascalCase for component names?
Yes! The CLI supports both formats:
npx rareui add liquid-button(kebab-case)npx rareui add LiquidButton(PascalCase)
Both will install the same component. Use whichever format you prefer!
How do I know if my components need updates?
Run the diff command to check for updates:
npx rareui@latest diffThis will show you which components have updates available and what changed.
Where are components installed?
Components are installed to components/rareui/ in your project directory. For example:
- Buttons:
components/rareui/buttons/ - Cards:
components/rareui/cards/ - Loaders:
components/rareui/loaders/
What if I want to customize a component?
All components are installed as source code in your project, so you can customize them freely! Just edit the files in components/rareui/ after installation.
I'm getting "pnpm/yarn/bun is not recognized" error
This means the package manager isn't installed on your system. Solution: Use npm instead (comes with Node.js):
npx rareui@latest init
npx rareui@latest add liquid-buttonWant to install that package manager?
- pnpm:
npm install -g pnpm - yarn:
npm install -g yarn - bun: Visit bun.sh for installation
Most users just use npm - it works perfectly!
Which package manager should I use?
All package managers work perfectly with RareUI:
- npm: Built-in with Node.js, most widely used
- pnpm: Faster, more disk-efficient
- yarn: Great workspace support
- bun: Fastest JavaScript runtime
Choose the one you prefer or the one your project already uses!