The official CLI for Ruma UI — scaffold projects, initialise configuration, and add components to your React application in one command.
Documentation · npm · GitHub
- Overview
- Usage (no install needed)
- Commands
- components.json Schema
- Package Manager Detection
- Supported Frameworks
- Registry
- Contributing
@ruma-kit/cli is a zero-config CLI that brings the Ruma UI component library into any React project:
init— detect your framework, configure aliases, createcomponents.json, install utilitiesadd— pull individual components from the Ruma registry directly into your source tree
Components are copied as source files (not imported from npm), giving you full ownership and customisability — similar to shadcn/ui.
The npm package
@ruma-kit/uicontains the pre-built, tree-shakeable version of the library. The CLI is the alternative "copy-into-your-project" approach — use whichever fits your workflow.
Run without installing using npx:
npx @ruma-kit/cli <command> [options]Or install globally:
npm install -g @ruma-kit/cli
ruma-ui <command> [options]Initialises Ruma UI in your project. Run this once per project.
npx @ruma-kit/cli init [options]- Detects whether a
package.jsonexists - If not — optionally scaffolds a new Next.js project for you
- Prompts you to configure path aliases (or uses sensible defaults with
--yes) - Creates
components.jsonat the project root - Generates
lib/utils.tswith thecn()helper - Installs
clsxandtailwind-mergeusing your detected package manager
| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--cwd <path> |
-c |
string |
process.cwd() |
Working directory to initialise in |
--yes |
-y |
boolean |
false |
Skip all prompts and use defaults |
--template <name> |
-t |
string |
"next" |
Template to scaffold when no project exists (next supported) |
--name <name> |
-n |
string |
"my-app" |
Name for the new scaffolded project directory |
# Interactive — asks alias and CSS file questions
npx @ruma-kit/cli init
# Non-interactive — uses all defaults instantly
npx @ruma-kit/cli init --yes
# Scaffold a brand-new Next.js app called "my-dashboard" and initialise
npx @ruma-kit/cli init --template next --name my-dashboard --yes
# Initialise inside a specific directory
npx @ruma-kit/cli init --cwd ./apps/webWhen run without --yes, init asks:
? Configure the import alias for components: › @/components
? Configure the import alias for utils: › @/lib/utils
? Where is your global CSS file? › src/app/globals.css
🚀 Initializing ruma-ui in /your/project
✔ components.json created successfully.
✔ Created src/lib/utils.ts
✔ Dependencies installed successfully.
🎉 ruma-ui initialized! You can now add components using:
npx @ruma-kit/cli add button
Adds one or more Ruma UI components to your project by fetching them from the registry.
npx @ruma-kit/cli add [components...] [options]- Reads
components.jsonto determine target directory - Fetches the component definition from the registry (local or remote)
- Writes component source files to your configured
aliases.uidirectory - Remaps internal imports to match your configured aliases
- Installs any additional package dependencies the component requires
| Argument | Description |
|---|---|
[components...] |
One or more component names (case-insensitive) |
| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--cwd <path> |
-c |
string |
process.cwd() |
Working directory (must contain components.json) |
--overwrite |
-o |
boolean |
false |
Overwrite existing component files |
# Add a single component
npx @ruma-kit/cli add button
# Add multiple components at once
npx @ruma-kit/cli add button card modal toast
# Overwrite existing files
npx @ruma-kit/cli add button --overwrite
# Add components to a specific directory
npx @ruma-kit/cli add table --cwd ./apps/dashboardAll 49 components from @ruma-kit/ui are available via add:
accordion alert avatar badge breadcrumb
button calendar card carousel checkbox
clipboard contextmenu datepicker drawer dropdown
editable fileupload fab form image
inputotp keyboardkey link loader modal
multiselect navmenu pagination popover progress
radiogroup rangeinput rating resizable select
skeleton slider sortablelist stepper switch
table tabs textarea textinput toast
tooltip toploader treeview video
⠸ Fetching button from registry...
✔ Added Button to @/components/ui
⠸ Fetching modal from registry...
✔ Added Modal to @/components/ui
⠸ Fetching table from registry...
⠸ Installing dependencies (react-table)...
✔ Added Table to @/components/ui
The components.json file at your project root configures how the CLI discovers and places components.
{
"$schema": "https://ruma.5dev.in/schema.json",
"style": "default",
"tsx": true,
"tailwind": {
"css": "src/app/globals.css",
"baseColor": "neutral",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui"
}
}| Field | Type | Description |
|---|---|---|
$schema |
string |
JSON Schema URL for editor autocompletion |
style |
"default" |
Component style variant (only "default" is currently available) |
tsx |
boolean |
Whether to use .tsx (default) or .jsx file extension |
tailwind.css |
string |
Path to your global CSS file (relative to project root) |
tailwind.baseColor |
string |
Base colour palette: "neutral", "slate", "zinc", "stone", "gray" |
tailwind.cssVariables |
boolean |
Use CSS custom properties for theming (true recommended) |
aliases.components |
string |
TypeScript path alias for your components directory |
aliases.utils |
string |
TypeScript path alias for the cn() utility |
aliases.ui |
string |
TypeScript path alias where Ruma UI components are placed |
The CLI automatically detects which package manager your project uses:
| Lock file | Detected manager |
|---|---|
pnpm-lock.yaml |
pnpm |
bun.lockb / bun.lock |
bun |
yarn.lock |
yarn |
(none / package-lock.json) |
npm |
Detection is based on the lock file present in the working directory (or process.cwd() when none is specified).
| Framework | init support |
Notes |
|---|---|---|
| Next.js (App Router) | ✅ Full | Scaffolding + auto CSS detection |
| Next.js (Pages Router) | ✅ Full | CSS detection targets styles/globals.css |
| Vite + React | ✅ Full | CSS detection targets src/index.css |
| Create React App | ✅ Full | CSS detection targets src/index.css |
| Remix | ✅ Full | Manual CSS link still required in root.tsx |
| Astro | Works for React islands; no scaffolding support | |
| Expo (React Native) | ❌ | Web-only library |
Components are fetched from the Ruma UI component registry at:
https://ruma.5dev.in/r/<component-name>.json
Each registry entry contains:
{
"name": "button",
"title": "Button",
"description": "A versatile button component with multiple variants and sizes.",
"files": [
{
"path": "components/Button/Button.tsx",
"content": "..."
}
],
"dependencies": ["@radix-ui/react-slot"],
"devDependencies": []
}The CLI first checks for a local registry (useful in monorepo setups) before falling back to the remote registry:
dist/registry/<name>.json(local build)www/public/r/<name>.json(local dev server)https://ruma.5dev.in/r/<name>.json(remote CDN)
See the monorepo CONTRIBUTING.md for full guidelines.
# Clone and set up
git clone https://github.com/ruma-ui/ui.git
cd ui
pnpm install
# Work on the CLI
cd packages/cli
pnpm dev # watch mode rebuildMIT © Ruma UI