Skip to Content
Guide

CLI

The Kiva UI CLI for authentication, project scaffolding, and component management.

The @kivacore/ui-cli is a command-line tool that handles authentication, project creation, component installation, theme management, and code generation from the Kiva registry.

npm

Installation

You can use the CLI directly with npx without installing it globally:

npx @kivacore/ui-cli <command>

Or install it globally:

pnpm add -g @kivacore/ui-cli

Or install it globally for quicker access:

pnpm add -g @kivacore/ui-cli

Once installed globally, you can use the kiva-ui command directly:

kiva-ui add button

Commands

Authentication

CommandDescription
kiva-ui loginLog in with browser-based SSO
kiva-ui login --emailLog in with email and password
kiva-ui login -e user@example.comLog in with pre-filled email
kiva-ui logoutClear stored auth tokens
kiva-ui whoamiDisplay current logged-in user info

Components

CommandDescription
kiva-ui add [items...]Add components, hooks, or utilities from the registry
kiva-ui add button dialogAdd multiple components at once
kiva-ui add --all webInstall all web components
kiva-ui add --all react-nativeInstall all React Native components
kiva-ui add --all-webShortcut for --all web
kiva-ui add --all-rnShortcut for --all react-native
kiva-ui add --overwriteSkip file conflict prompts
kiva-ui add --dry-runPreview installation without writing files
kiva-ui add --path ./src/uiCustom target path for installation
kiva-ui updateUpdate all installed Kiva components to latest
kiva-ui update button toastUpdate specific components only
kiva-ui update rn-card rn-buttonUpdate specific native components
kiva-ui update --pruneUpdate and remove components deleted from registry
kiva-ui update --dry-runPreview what would be updated
kiva-ui listList available components, hooks, and utilities
kiva-ui list --packagesList published @kivacore npm packages

React Native projects

Web components require components.json (created by npx shadcn@latest init). React Native components (rn-*) work without components.json — the CLI reads your import alias from tsconfig.json or tsconfig.base.json automatically.

Your tsconfig must have a path alias configured:

{
  "compilerOptions": {
    "paths": {
      "@/*": ["./*"]
    }
  }
}

If no path alias is found, the CLI defaults to @/ and adds the alias to your tsconfig automatically.

Themes

CommandDescription
kiva-ui themes listList available theme presets
kiva-ui themes add [name]Apply a theme preset to your project
kiva-ui themes add --url <url>Apply theme from a share URL
kiva-ui themes add --file <path>Apply theme from a local JSON file
kiva-ui themes currentShow current :root and .dark CSS variables

Code Generation

CommandDescription
kiva-ui generate api-specDownload OpenAPI spec from the Kiva API
kiva-ui generate api-spec -o ./spec.jsonCustom output path for the spec file
kiva-ui generate db [spec]Generate TanStack Query collections from an OpenAPI spec
kiva-ui generate db ./spec.json -o ./src/apiCustom output directory

Project Setup

CommandDescription
kiva-ui commitlintSet up commitlint, husky, and lint-staged
kiva-ui commitlint --scopes cli,ui,webPre-configure allowed commit scopes
kiva-ui commitlint --monorepoAuto-detect workspace scopes for monorepo
kiva-ui commitlint --scope-strategy requiredSet scope strategy (required, optional, none)
kiva-ui commitlint -yAccept defaults and overwrite existing files

System

CommandDescription
kiva-ui infoDisplay CLI version, Node.js, OS, and auth status
kiva-ui config --showShow current configuration
kiva-ui config --tokenUpdate the stored Kiva token
kiva-ui config --themeChange help output color theme
kiva-ui upgradeUpgrade CLI to the latest version
kiva-ui completion <shell>Generate shell completion script (bash, zsh, fish)

Global Options

OptionDescription
--jsonOutput results in JSON format
-v, --versionDisplay CLI version
-h, --helpDisplay help information

Examples

# Log in and add components
kiva-ui login
kiva-ui add button dialog date-time-picker
kiva-ui add --all web
kiva-ui add --all-rn

# Update all installed components
kiva-ui update

# Update specific components
kiva-ui update button toast rn-card

# Update and remove components deleted from registry
kiva-ui update --prune

# Browse and apply a theme
kiva-ui themes list
kiva-ui themes add midnight

# Generate TanStack Query code from an API spec
kiva-ui generate api-spec
kiva-ui generate db openapi.json --output src/

# Set up commitlint in a monorepo
kiva-ui commitlint --monorepo

On this page