# CLI URL: /docs/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](https://www.npmjs.com/package/@kivacore/ui-cli) ## Installation You can use the CLI directly with `npx` without installing it globally: ```bash npx @kivacore/ui-cli ``` Or install it globally: ```bash tab="pnpm" pnpm add -g @kivacore/ui-cli ``` ```bash tab="npm" npm install -g @kivacore/ui-cli ``` ```bash tab="yarn" yarn global add @kivacore/ui-cli ``` ```bash tab="bun" bun add -g @kivacore/ui-cli ``` Or install it globally for quicker access: Once installed globally, you can use the `kiva-ui` command directly: ```bash kiva-ui add button ``` ## Commands ### Authentication | Command | Description | |---------|-------------| | `kiva-ui login` | Log in with browser-based SSO | | `kiva-ui login --email` | Log in with email and password | | `kiva-ui login -e user@example.com` | Log in with pre-filled email | | `kiva-ui logout` | Clear stored auth tokens | | `kiva-ui whoami` | Display current logged-in user info | ### Components | Command | Description | |---------|-------------| | `kiva-ui add [items...]` | Add components, hooks, or utilities from the registry | | `kiva-ui add button dialog` | Add multiple components at once | | `kiva-ui add --all web` | Install all web components | | `kiva-ui add --all react-native` | Install all React Native components | | `kiva-ui add --all-web` | Shortcut for `--all web` | | `kiva-ui add --all-rn` | Shortcut for `--all react-native` | | `kiva-ui add --overwrite` | Skip file conflict prompts | | `kiva-ui add --dry-run` | Preview installation without writing files | | `kiva-ui add --path ./src/ui` | Custom target path for installation | | `kiva-ui update` | Update all installed Kiva components to latest | | `kiva-ui update button toast` | Update specific components only | | `kiva-ui update rn-card rn-button` | Update specific native components | | `kiva-ui update --prune` | Update and remove components deleted from registry | | `kiva-ui update --dry-run` | Preview what would be updated | | `kiva-ui list` | List available components, hooks, and utilities | | `kiva-ui list --packages` | List published @kivacore npm packages | ### Themes | Command | Description | |---------|-------------| | `kiva-ui themes list` | List available theme presets | | `kiva-ui themes add [name]` | Apply a theme preset to your project | | `kiva-ui themes add --url ` | Apply theme from a share URL | | `kiva-ui themes add --file ` | Apply theme from a local JSON file | | `kiva-ui themes current` | Show current `:root` and `.dark` CSS variables | ### Code Generation | Command | Description | |---------|-------------| | `kiva-ui generate api-spec` | Download OpenAPI spec from the Kiva API | | `kiva-ui generate api-spec -o ./spec.json` | Custom 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/api` | Custom output directory | ### Project Setup | Command | Description | |---------|-------------| | `kiva-ui commitlint` | Set up commitlint, husky, and lint-staged | | `kiva-ui commitlint --scopes cli,ui,web` | Pre-configure allowed commit scopes | | `kiva-ui commitlint --monorepo` | Auto-detect workspace scopes for monorepo | | `kiva-ui commitlint --scope-strategy required` | Set scope strategy (required, optional, none) | | `kiva-ui commitlint -y` | Accept defaults and overwrite existing files | ### System | Command | Description | |---------|-------------| | `kiva-ui info` | Display CLI version, Node.js, OS, and auth status | | `kiva-ui config --show` | Show current configuration | | `kiva-ui config --token` | Update the stored Kiva token | | `kiva-ui config --theme` | Change help output color theme | | `kiva-ui upgrade` | Upgrade CLI to the latest version | | `kiva-ui completion ` | Generate shell completion script (bash, zsh, fish) | ### Global Options | Option | Description | |--------|-------------| | `--json` | Output results in JSON format | | `-v, --version` | Display CLI version | | `-h, --help` | Display help information | ## Examples ```bash # 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 ```