Use the MateUI CLI to initialize your project, add, update, remove, and list components directly from the terminal.
The MateUI CLI is the fastest way to manage components in your project. It connects to the official registry and lets you install, update, and remove components without leaving your terminal.
Installation
You don't need to install anything globally. Use
pnpm dlx or npx to run the CLI on demand:1pnpm dlx mateui <command>2# or3npx mateui <command>
Commands
init
Initializes MateUI in your project. This is the first command you should run. It will:
- Fetch the available themes from the registry.
- Ask you to select a theme interactively.
- Create a
mateui.jsonconfiguration file in the root of your project. - Inject the CSS design tokens into your stylesheet (
src/app/globals.cssfor Next.js orsrc/index.cssfor Vite). - Generate the
cnutility function in the path defined byaliases.utils.
1pnpm dlx mateui init
After running
init, your project will contain a mateui.json file like this:1{2 "$schema": "...",3 "style": "default",4 "tailwind": {5 "config": "",6 "baseColor": "zinc",7 "css": "src/app/globals.css"8 },9 "aliases": {10 "components": "@/components/ui",11 "utils": "@/lib/utils"12 }13}
Info
If
mateui.json already exists, init will detect it and skip re-injecting tokens to avoid
duplicates.add
Adds a component from the registry to your project. Requires
mateui.json to exist (run init first).1pnpm dlx mateui add <component>
Example:
1pnpm dlx mateui add button
What it does:
- Fetches the component source code from the registry.
- Writes the component file to the path defined in
aliases.components(e.g.,src/components/ui/button.tsx). - Checks if the component has external dependencies.
- If missing dependencies are found, prompts you to install them automatically using your package manager (npm, pnpm, yarn, or bun — auto-detected).
Tip
Use
pnpm dlx mateui list to see all available component slugs.list
Lists all components currently available in the MateUI registry.
1pnpm dlx mateui list
Output example:
1→ Button (button)2→ Input (input)3 Deps: react-hook-form4→ Dialog (dialog)
Each entry shows the component name, its slug (used with
add/update/remove), and any required dependencies.update
Fetches the latest version of an already-installed component from the registry and overwrites the local file.
1pnpm dlx mateui update <component>
Example:
1pnpm dlx mateui update button
Warning
Running
update will overwrite your local changes to that component. You will be asked to
confirm before the update is applied.The command will:
- Verify the component is installed (the file exists in
aliases.components). - Fetch the latest code from the registry.
- Ask for confirmation before writing.
- Replace the local file with the updated version.
remove
Removes an installed component from your project by deleting its file (or folder) from the components directory.
1pnpm dlx mateui remove <component>
Example:
1pnpm dlx mateui remove button
The command looks for
button.tsx (or a button/ folder) inside src/components/ui/. If found, it asks for confirmation before permanently deleting the file.Warning
This action cannot be undone. Make sure you no longer need the component before confirming.
Typical workflow
1# 1. Initialize MateUI in your project2pnpm dlx mateui init34# 2. Browse available components5pnpm dlx mateui list67# 3. Add a component8pnpm dlx mateui add button910# 4. Update a component to the latest version11pnpm dlx mateui update button1213# 5. Remove a component you no longer need14pnpm dlx mateui remove button
Configuration file
The
mateui.json file is created by init and is required by the add, update, and remove commands. It controls where components and utilities are placed inside your project.| Field | Description |
|---|---|
style | The selected theme style |
tailwind.css | Path to your main CSS file |
aliases.components | Import alias for the components directory |
aliases.utils | Import alias for the cn utility |
If this file is missing, most commands will fail and ask you to run
mateui init first.