Use the NachUI CLI to initialize your project, add, update, remove, and list components directly from the terminal.
The NachUI 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 nachui <command>2# or3npx nachui <command>
Commands
init
Initializes NachUI 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
nachui.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 nachui init
After running
init, your project will contain a nachui.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
nachui.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
nachui.json to exist (run init first).1pnpm dlx nachui add <component>
Example:
1pnpm dlx nachui 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 nachui list to see all available component slugs.list
Lists all components currently available in the NachUI registry.
1pnpm dlx nachui 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 nachui update <component>
Example:
1pnpm dlx nachui 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 nachui remove <component>
Example:
1pnpm dlx nachui 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 NachUI in your project2pnpm dlx nachui init34# 2. Browse available components5pnpm dlx nachui list67# 3. Add a component8pnpm dlx nachui add button910# 4. Update a component to the latest version11pnpm dlx nachui update button1213# 5. Remove a component you no longer need14pnpm dlx nachui remove button
Configuration file
The
nachui.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
nachui init first.