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.

npm

Installation

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

npx @docyrus/cli <command>

Or install it globally:

pnpm add -g @docyrus/cli

Or install it globally for quicker access:

pnpm add -g @docyrus/cli

Once installed globally, you can use the docyrus command directly:

docyrus add button

Commands

Authentication

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

Components

CommandDescription
docyrus add [items...]Add components, hooks, or utilities from the registry
docyrus add button dialogAdd multiple components at once
docyrus add --all webInstall all web components
docyrus add --all react-nativeInstall all React Native components
docyrus add --all-webShortcut for --all web
docyrus add --all-rnShortcut for --all react-native
docyrus add --overwriteSkip file conflict prompts
docyrus add --dry-runPreview installation without writing files
docyrus add --path ./src/uiCustom target path for installation
docyrus updateUpdate all installed Docyrus components to latest
docyrus update button toastUpdate specific components only
docyrus update rn-card rn-buttonUpdate specific native components
docyrus update --pruneUpdate and remove components deleted from registry
docyrus update --dry-runPreview what would be updated
docyrus listList available components, hooks, and utilities
docyrus list --packagesList published @docyrus 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
docyrus themes listList available theme presets
docyrus themes add [name]Apply a theme preset to your project
docyrus themes add --url <url>Apply theme from a share URL
docyrus themes add --file <path>Apply theme from a local JSON file
docyrus themes currentShow current :root and .dark CSS variables

Code Generation

CommandDescription
docyrus generate api-specDownload OpenAPI spec from the Docyrus API
docyrus generate api-spec -o ./spec.jsonCustom 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/apiCustom output directory

Project Setup

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

System

CommandDescription
docyrus infoDisplay CLI version, Node.js, OS, and auth status
docyrus config --showShow current configuration
docyrus config --tokenUpdate the stored Docyrus token
docyrus config --themeChange help output color theme
docyrus upgradeUpgrade CLI to the latest version
docyrus 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
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

On this page