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