CLI

Use the Cubix CLI to initialize a project, add components from the registry, inspect items before install, and publish registry JSON.

init

Use the init command to configure an existing project. It installs shared dependencies, adds the cn util, writes design tokens to your CSS entry, and creates cubix.json.

pnpm dlx cubix@latest init

Options:

Terminal
Usage: cubix init [options]

initialize your project and install dependencies

Options:
  -b, --base <base>   the primitive backend to use (base, radix, aria)
  -y, --yes           skip confirmation prompt
  -f, --force         force overwrite of existing configuration
  -c, --cwd <cwd>     the working directory (default: current directory)
  -s, --silent        mute output
  -h, --help          display help for command

Pass --base aria or --base radix to set the default primitive backend. See Installation for the full setup flow.

add

Use the add command to copy components and their dependencies into your project.

pnpm dlx cubix@latest add [component]

Add a single component:

pnpm dlx cubix@latest add button

Add several at once:

pnpm dlx cubix@latest add button card dialog

Override the project base for one install:

pnpm dlx cubix@latest add button --base aria

Options:

Terminal
Usage: cubix add [options] [components...]

add a component to your project

Arguments:
  components          name, url, or local path to a component

Options:
  -b, --base <base>   override the project base (base, radix, aria)
  -y, --yes           skip confirmation prompt
  -o, --overwrite     overwrite existing files
  -c, --cwd <cwd>     the working directory (default: current directory)
  -a, --all           add all available components
  -p, --path <path>   the path to add the component to
  -s, --silent        mute output
  --dry-run           preview changes without writing files
  -h, --help          display help for command

view

Use the view command to inspect registry items before installing them - files, dependencies, and metadata.

pnpm dlx cubix@latest view button

You can view multiple items in one call:

pnpm dlx cubix@latest view button card dialog

Options:

Terminal
Usage: cubix view [options] <items...>

view items from the registry before installing them

Arguments:
  items               the item names or URLs to view

Options:
  -c, --cwd <cwd>     the working directory (default: current directory)
  -h, --help          display help for command

search

Use the search command to find components in the Cubix registry. list is an alias.

pnpm dlx cubix@latest search -q "button"

Options:

Terminal
Usage: cubix search|list [options] [registries...]

search items from registries

Options:
  -q, --query <query>    query string
  -l, --limit <number>   maximum number of items to display (default: 100)
  -o, --offset <number>  number of items to skip (default: 0)
  -c, --cwd <cwd>        the working directory (default: current directory)
  -h, --help             display help for command

build

Use the build command to generate registry JSON files from your registry.json. Output lands in public/r by default - the same shape served by this docs site.

pnpm dlx cubix@latest build

Customize the output directory:

pnpm dlx cubix@latest build --output ./public/registry

Options:

Terminal
Usage: cubix build [options] [registry]

build components for a Cubix registry

Arguments:
  registry             path to registry.json (default: ./registry.json)

Options:
  -o, --output <path>  destination directory for JSON files (default: ./public/r)
  -c, --cwd <cwd>      the working directory (default: current directory)
  -h, --help           display help for command

More on publishing and schema on the Registry page.

info

Use the info command to print project configuration from cubix.json - base, aliases, Tailwind CSS entry, and related settings.

pnpm dlx cubix@latest info

Options:

Terminal
Usage: cubix info [options]

get information about your project

Options:
  -c, --cwd <cwd>  the working directory (default: current directory)
  --json           output as JSON
  -h, --help       display help for command