Docs Getting Started CLI

CLI Reference

Complete command reference for the Static UI command-line interface.


The Static UI CLI (static-ui) is the primary gateway for generating components, managing themes, and maintaining your workspace configuration. All commands follow the pnpm dlx static-ui init<command> pattern.

Package Manager Support

Static UI automatically detects your project's package manager during init by scanning for lock files:

npm
npmpackage-lock.json
pnpm
pnpmpnpm-lock.yaml
yarn
yarnyarn.lock
bun
bunbun.lockb

If detection fails, you can manually select your package manager during the setup prompt. The selected package manager is stored in your static.json configuration.

init

Scaffolds a fresh static.json configuration file in your project root. This sets up the workspace engine environment required for all subsequent CLI operations.

$pnpm dlx static-ui init

Flags

--yes, -yAccept defaults without prompting--dir <path>Target directory for initialization
add

<component> — Component name (e.g. button, accordion, dialog)

Downloads and injects one or more component primitives directly into your source tree. Components are placed according to the output paths defined in static.json.

$pnpm dlx static-ui add <component>

Flags

--path <dir>Override output directory--allAdd all available components
doctor

Runs a diagnostic check against your workspace to detect configuration issues, missing dependencies, and version mismatches in your static.json setup.

$pnpm dlx static-ui init

Flags

--fixAttempt auto-correction of detected issues--verboseDetailed diagnostic output
theme

<theme-name> — One of: green, blue, zinc, slate, gaming, cyberpunk, modern

Generates or updates CSS theme variable sets from the bundled theme JSON definitions. Applies the selected theme's color tokens to your global stylesheet.

$pnpm dlx static-ui theme <theme-name>

Flags

--output <path>Write theme CSS to a custom path--listList all available themes
search

<query> — Search term to match against component metadata

Queries the component registry for available primitives matching the provided search terms. Returns matching component names and brief descriptions.

$pnpm dlx static-ui init <query>
list

Prints a formatted inventory of every component available in the registry, optionally filtered by category or installation status.

$pnpm dlx static-ui init

Flags

--installedOnly show already-installed components--jsonOutput in JSON format
update

[component] — Optional specific component to update; omits all

Pulls the latest revisions of installed component files from the upstream registry. Existing files are merged rather than overwritten to preserve local customizations.

$pnpm dlx static-ui init [component]

Flags

--dry-runPreview changes without writing files--forceOverwrite local changes
diff

Compares your local component files against the latest registry versions and displays a colorized diff of any differences that need reconciliation.

$pnpm dlx static-ui init [component]

Flags

--statSummary statistics only, no full diff
info

Displays detailed metadata about your Static UI workspace, including installed components, current theme, configuration paths, and version numbers.

$pnpm dlx static-ui init

Flags

--jsonOutput all info as JSON
migrate

Handles migration of components and configurations between major versions of the CLI. Automatically detects the source version and applies the correct transform pipeline.

$pnpm dlx static-ui init

Flags

--from <version>Explicit source version override--dry-runPreview migration without applying