@kivacore/ui-cli
v0.27.2
Published
Kiva UI CLI - add, update and theme Kiva UI components
Readme
Kiva UI CLI
Command-line tool for the Kiva UI component library. It adds, updates and migrates Kiva UI components, hooks and themes in your project. It only reads the public Kiva UI registry, so it needs no account or sign-in.
Usage
npx @kivacore/ui-cli <command>Local build
Run pnpm build from this package. It needs no environment variables or secrets. The build uses tsup 9 and writes both the CLI and library to dist/. For local builds, tsup supports Node 22.18+, 24.11+, or 26+ on those release lines.
Commands
Component Registry
Components come from https://ui.kivacore.com/r. To use another registry, see Environment Variables.
add [items...]
Add Kiva UI components, hooks, or utilities to your project.
Prerequisite: Run npx shadcn@latest init first to create components.json.
npx @kivacore/ui-cli add button # Add a component
npx @kivacore/ui-cli add button dialog # Add multiple components
npx @kivacore/ui-cli add --all # Install all available components
npx @kivacore/ui-cli add hooks-debounce # Add a hook
npx @kivacore/ui-cli add rn-button # Add a React Native component
npx @kivacore/ui-cli add rn-hooks-use-kiva-tenant # Add a React Native hook
npx @kivacore/ui-cli add utils-cn # Add a utility
npx @kivacore/ui-cli add button --dry-run # Preview installation
npx @kivacore/ui-cli add button -o # Overwrite existing files
npx @kivacore/ui-cli add button -p ./src/ui # Custom target pathWhat happens:
- Resolves components and their dependencies from the Kiva registry
- Installs vendor primitives by fetching vendor registry items (shadcn/Plate) and writing files via
components.jsonaliases - Writes Kiva component files to
components/kiva/ - Installs npm dependencies
- Bundled lib/hook files are shared across components (written once, skipped if exists)
- Plate installs always include core editor primitives (
editor,editor-kit) for editor/static compatibility - Vendor-component files (e.g. editor/) are bundled with the component
Registry Names:
| Input | Registry Name |
|-------|---------------|
| button | @kivacore/ui-button |
| hooks-debounce | @kivacore/hooks-debounce |
| utils-cn | @kivacore/utils-cn |
| rn-button | @kivacore/rn-button → components/kiva-native/ |
| rn-hooks-use-kiva-tenant | @kivacore/rn-hooks-use-kiva-tenant → hooks/kiva-native/ |
--all react-native / --all-rn installs every @kivacore/rn-* item — native components and native hooks.
Options:
| Option | Description |
|--------|-------------|
| -a, --all | Install all available components from the registry |
| -o, --overwrite | Overwrite existing files without prompting |
| -d, --dry-run | Show what would be installed without making changes |
| -p, --path <path> | Custom target path for files |
update
Update all installed Kiva components to the latest version from the registry. Detects and optionally removes components that were deleted from the registry.
npx @kivacore/ui-cli update # Update all installed components
npx @kivacore/ui-cli update --prune # Update and remove stale components
npx @kivacore/ui-cli update --dry-run # Preview what would be updatedScans components/kiva/, components/kiva-native/, hooks/kiva/ (web hooks) and hooks/kiva-native/ (native hooks, reported as rn-hooks-<name>) to detect installed items, resolves latest versions from the registry, and updates all files including new vendor primitives and npm dependencies. Components that no longer exist in the registry are reported as stale — use --prune to remove them.
Options:
| Option | Description |
|--------|-------------|
| -d, --dry-run | Show what would be updated without making changes |
| --prune | Remove locally installed components that no longer exist in the registry |
list
List available Kiva UI registry items (components, hooks, utilities) or published npm packages.
npx @kivacore/ui-cli list # List registry components
npx @kivacore/ui-cli list --packages # List published @kivacore npm packages
npx @kivacore/ui-cli list --json # Output as JSONOptions:
| Option | Description |
|--------|-------------|
| --packages | List published @kivacore npm packages instead |
themes
Browse and manage Kiva UI themes.
themes list
List all available theme presets.
npx @kivacore/ui-cli themes listthemes add [name]
Apply a theme to your project's globals.css.
npx @kivacore/ui-cli themes add midnight # Apply a theme preset by name
npx @kivacore/ui-cli themes add --url <share-url> # Apply theme from a share URL
npx @kivacore/ui-cli themes add --file ./theme.json # Apply theme from a local JSON fileOptions:
| Option | Description |
|--------|-------------|
| --url <url> | Apply theme from a share URL (overrides name argument) |
| --file <path> | Apply theme from a local JSON file (overrides name argument) |
themes current
Display current :root and .dark CSS variables from your globals.css.
npx @kivacore/ui-cli themes currentProject Setup
commitlint
Set up commitlint, husky, and lint-staged in your project.
npx @kivacore/ui-cli commitlintCLI Management
upgrade
Upgrade the CLI to the latest version. Automatically detects your package manager (npm, pnpm, yarn, bun).
npx @kivacore/ui-cli upgradeinfo
Display the CLI version, system information, the registry URL and the config file location.
npx @kivacore/ui-cli infoconfig
Show the configuration, or change the color theme of the help output.
npx @kivacore/ui-cli config # Show configuration
npx @kivacore/ui-cli config --theme # Pick a help color themeGlobal Options
--json
Output results in JSON format. Useful for scripting and CI/CD pipelines.
npx @kivacore/ui-cli list --json
npx @kivacore/ui-cli info --json-v, --version
Display the CLI version.
-h, --help
Display help information.
npx @kivacore/ui-cli --help
npx @kivacore/ui-cli add --helpEnvironment Variables
All are optional and read at runtime.
| Variable | Description |
|----------|-------------|
| KIVA_REGISTRY_URL | Kiva UI registry base URL (default https://ui.kivacore.com/r) |
| KIVA_SHADCN_REGISTRY_URL | shadcn registry URL (default <registry>/shadcn) |
| KIVA_PLATE_REGISTRY_URL | Plate registry URL (default <registry>/plate) |
| KIVA_AI_ELEMENTS_REGISTRY_URL | AI Elements registry URL (default <registry>/ai-elements) |
The help theme setting is stored with conf under the docyrus project name, the name from before the Kiva rename, so existing settings carry over. kiva-ui info shows the file path.
License
MIT
