ZBMui

CLI

View markdown

Initialize your project and install components with the ZBM UI CLI.

The ZBM UI CLI (@zbmui/cli) is the easiest way to set up ZBM UI. It copies components into your project as source files you own and maintain — nothing is hidden behind an npm package. Components can then be updated independently, without waiting for a new library release.

Prerequisites

The CLI validates your project before doing anything. Make sure you have:

  • Node.js 24 or later
  • A Next.js or Vite project
  • Tailwind CSS v4 (CSS-first configuration)
  • A tsconfig.json with path aliases, such as "@/*": ["./src/*"]

init

Run the following command at the root of your project:

init sets up everything ZBM UI needs:

  1. Detects your framework and checks that Tailwind CSS v4 and your tsconfig path aliases are in place.
  2. Asks where your global CSS file lives and which import aliases to use (skipped with -y).
  3. Writes a components.json config file to your project root.
  4. Installs the cn() utility into your lib directory.
  5. Writes the theme CSS files to src/styles/ (or styles/ if your project has no src directory) and injects the @import lines into your global CSS, right after @import "tailwindcss";.
  6. Installs any missing base dependencies using your detected package manager (pnpm, npm, yarn, or bun).

If a components.json already exists, the CLI asks before overwriting it.

init options

OptionDescription
-y, --yesUse the default configuration without prompting. Fails if components.json already exists.
--cwd <path>Run against a project directory other than the current working directory.
--registry <url>Use a custom registry — an HTTP URL or a local directory containing registry JSON.

add

Add components to your project by name:

You can install multiple components in one command:

Running add with no arguments opens an interactive picker listing every available component. Registry dependencies (hooks and utilities such as cn()) are resolved and installed automatically, along with any npm packages the components rely on.

add options

OptionDescription
-a, --allInstall all available components.
-o, --overwriteOverwrite existing files. Without this flag, the CLI keeps existing files and asks before replacing them.
-y, --yesSkip confirmation prompts. Never overwrites existing files — combine with --overwrite for that.
--cwd <path>Project directory. Defaults to the current working directory.
--registry <url>Registry URL or local directory. Overrides the registry from components.json.

In non-interactive environments (CI, piped input), pass component names or --all — without a terminal, add can't show the picker and exits with an error instead.

list

See everything the registry offers, grouped by type (ui, hook, lib, ...):

Pass --json to print the raw registry index instead.

Configuration

init writes a components.json file into your project root. The CLI reads it on every add to know where to place files:

components.json
FieldDescription
rscWhether the project uses React Server Components (set automatically for Next.js).
tsxWhether the project uses TSX syntax.
tailwind.cssPath to the global CSS file where the ZBM UI theme imports are injected.
aliases.componentsImport alias for example components. Must resolve via the paths in your tsconfig.
aliases.uiImport alias for UI components.
aliases.hooksImport alias for hooks.
aliases.libImport alias for lib utilities such as cn().

Every alias must resolve through your tsconfig paths — that is how the CLI decides where to write files. Change them here (or re-run init) if your project uses a different layout.

Custom registry

By default, the CLI fetches components from https://ui.zubayer.dev/r. You can point it at a different registry — an HTTP URL or a local directory containing registry JSON — in three ways, in order of precedence:

  1. The --registry flag on any command.
  2. The ZBMUI_REGISTRY_URL environment variable.
  3. The registry field in components.json.
ZBMui

Built by the ZBM.

© 2026 ZBM ui. All rights reserved.