Skip to main content

CLI

Run registry-build from config roots, CI, or local package scripts.

Main command

registry-build build

The CLI discovers registry-build.config.* starting from the current working directory unless --config or --cwd is set.


Build flags

FlagPurpose
-c, --config <path>Use a specific config file
--cwd <path>Change config discovery root
--silentHide banner and summary output
--jsonEmit machine-readable build summary
--verbosePrint full error stack
--changed-onlyReuse cached work aggressively
--changed <paths...>Narrow rebuild work to affected paths

Common examples

Default build

registry-build build

Use a specific config file

registry-build build --config ./configs/registry-build.config.ts

Run from CI with JSON output

registry-build build --json --silent

Warm local rebuild for changed files only

registry-build build --changed-only --changed ../../packages/registry-ui/src/button/button.tsx

Package script patterns

Minimal:

{
  "scripts": {
    "build:reg": "registry-build build"
  }
}

Split raw build and formatting:

{
  "scripts": {
    "build:reg": "bun run build:reg:cli && bun run format:reg",
    "build:reg:cli": "registry-build build",
    "format:reg": "bunx biome format --write ./__ui_registry__/index.tsx"
  }
}

build:reg is the default one-command workflow; build:reg:cli stays available for direct flag usage.


Exit behavior

  • Validation or load errors fail the command with a non-zero exit code.
  • --verbose includes the full stack for debugging.
  • --json is useful for CI, custom dashboards, or local tooling wrappers.

Config discovery rules

Starting from the discovery root, the loader checks each filename below, then walks up one parent directory at a time and checks again until it finds a match or reaches the filesystem root.

The loader searches for these filenames:

  • registry-build.config.ts
  • registry-build.config.mts
  • registry-build.config.cts
  • registry-build.config.js
  • registry-build.config.mjs
  • registry-build.config.cjs
  • registry-build.config.json

Config-relative paths are normalized as soon as the config is loaded. That prevents the usual confusion between current working directory and config file location.