CLI

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

Run every command with your package manager. Prefer npx cubix-ui@latest (or the pnpm / yarn / bun equivalent) so you always get the newest CLI.

  • init

    Configure tokens, utils, and cubix.json - or scaffold a new app with -t.

  • add

    Copy components and dependencies into your project.

  • view

    Inspect registry items before you install them.

  • search

    Find items in the Cubix registry. list is an alias.

  • build

    Generate registry JSON from your registry.json.

  • info

    Print project config for humans and assistants.

init

Configure an existing project, or scaffold a new one with -t (next, vite, start, react-router, astro). Detects your framework, writes design tokens to its CSS entry, adds lib/utils.ts with cn, ensures the @/* alias, and creates cubix.json.

pnpm dlx cubix-ui@latest init

Scaffold Next.js and initialize Cubix in one step:

pnpm dlx cubix-ui@latest init -t next

Options:

Terminal
Usage: cubix-ui init [options] [components...]

initialize your project and install dependencies

Options:
  -t, --template <template>  scaffold a new project (next, vite, start, react-router, astro)
  -b, --base <base>          the primitive backend to use (base, radix, aria)
  -y, --yes                  skip confirmation prompts
  -f, --force                force overwrite of existing configuration
  -c, --cwd <cwd>            the working directory (default: current directory)
      --src-dir              use a src/ directory (Next.js template)
      --name <name>          project name when using --template
  -s, --silent               mute output
  -h, --help                 display help for command

Pass --base aria or --base radix to set the default primitive backend. Framework guides live on Installation.

add

Copy components and their dependencies into your project. Existing files are never replaced unless you pass --overwrite.

pnpm dlx cubix-ui@latest add [component]

Add a single component:

pnpm dlx cubix-ui@latest add button

Add several at once:

pnpm dlx cubix-ui@latest add button card dialog

Override the project base for one install:

pnpm dlx cubix-ui@latest add button --base aria

Options:

Terminal
Usage: cubix-ui 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

Inspect registry items before installing them - files, dependencies, and metadata.

pnpm dlx cubix-ui@latest view button

You can view multiple items in one call:

pnpm dlx cubix-ui@latest view button card dialog

Options:

Terminal
Usage: cubix-ui 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

Find components in the Cubix registry. list is an alias.

pnpm dlx cubix-ui@latest search -q "button"

Options:

Terminal
Usage: cubix-ui search|list [options]

search items from the registry

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

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-ui@latest build

Customize the output directory:

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

Options:

Terminal
Usage: cubix-ui 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

Print project configuration from cubix.json - base, aliases, Tailwind CSS entry, and related settings. Pair with Skills so assistants resolve the same context.

pnpm dlx cubix-ui@latest info

Options:

Terminal
Usage: cubix-ui 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

Registry URL

By default the CLI reads the official catalog from https://cubixflow.ir/r. Point it at a mirror, a staging deploy, or a local docs server with the CUBIX_REGISTRY_URL environment variable, or persist it per project under registries.cubix in cubix.json. The environment variable wins when both are set.

Terminal
CUBIX_REGISTRY_URL=https://registry.example.com/r npx cubix-ui@latest add button

Next steps