CLI

CLI Reference

Use the CLI to add components directly to your project source code.

CLI vs NPM Package

The CLI (brutx) copies component source files into your project for full customization. The NPM package (brutalist-ui) is a direct dependency import.

Compare both approaches →

init

Use the init command to initialize configuration and dependencies for a new project.

The init command installs dependencies, adds the cn util, configures CSS variables, and creates the component directory structure.

pnpm dlx brutx@latest init

Options

Usage: brutx init [options]

initialize your project and install dependencies

Options:
  -y, --yes          skip confirmation prompt. (default: false)
  -d, --defaults     use default configuration. (default: false)
  -c, --cwd <cwd>    the working directory. defaults to the current directory.
  -f, --force        force overwrite of existing configuration. (default: false)
  -s, --silent       mute output. (default: false)
  -h, --help         display help for command

add

Use the add command to add components and dependencies to your project.

pnpm dlx brutx@latest add [component]

Options

Usage: brutx add [options] [components...]

add a component to your project

Arguments:
  components         the components to add (space-separated)

Options:
  -y, --yes          skip confirmation prompt. (default: false)
  -o, --overwrite    overwrite existing files. (default: false)
  -a, --all          add all available components. (default: false)
  -p, --path <path>  the path to add the component to.
  -c, --cwd <cwd>    the working directory. defaults to the current directory.
  -s, --silent       mute output. (default: false)
  -h, --help         display help for command

Examples

Add a single component

npx brutx@latest add button

Add multiple components

npx brutx@latest add button card dialog

Add all components

pnpm dlx brutx@latest add --all

Add with custom path

npx brutx@latest add button -p src/components/custom

Overwrite existing files

npx brutx@latest add button --overwrite

Available Components

The following components are available for installation:

alertavatarbadgebuttoncalendarcardcheckboxcomboboxcommanddialogdropdown-menuinputlabelpaginationpopoverscroll-areaselectseparatorskeletonspinnersubmit-buttonswitchtabletabstextareatoasttooltip

27 components available • --all to install everything

components.json

The CLI creates a components.json file in your project root to store configuration.

{
  "$schema": "https://brutalistui.site/schema.json",
  "style": "brutalism",
  "tailwind": {
    "config": "tailwind.config.js",
    "css": "src/app/globals.css"
  },
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils"
  }
}
OptionDescription
tailwind.configPath to your tailwind.config.js file
tailwind.cssPath to your global CSS file
aliases.componentsImport alias for components directory
aliases.utilsImport alias for utils file

Troubleshooting

Command not found

If you get a "command not found" error, make sure you're using npx, pnpm dlx, yarn dlx, or bunx to run the CLI.

Components not found after installation

Make sure your tsconfig.json has the correct path aliases configured to match your components.json settings.

Tailwind styles not applying

Ensure your tailwind.config.js includes the path to your components in the content array.