CLI Support
Use the vayu-ui CLI to initialize, add, update, and remove components and hooks in your React project.
The vayu-ui CLI lets you scaffold Vayu UI into any React project with a copy-paste approach — you own the code, no runtime dependency required.
Quick Start
1. Create a new project with Vayu UI (Next.js or Vite)
npx vayu-ui-cli@latest create my-app2. Initialize Vayu UI in an existing project
npx vayu-ui-cli@latest init3. Browse what's available
npx vayu-ui-cli@latest list4. Add a component or hook
npx vayu-ui-cli@latest add buttonNo installation needed — npx runs the latest version directly.
vayu-ui create <name>
Scaffolds a brand new React project with Vayu UI pre-configured. Supports Next.js and Vite.
npx vayu-ui-cli@latest create my-appnpx vayu-ui-cli@latest create my-app --framework next --forcenpx vayu-ui-cli@latest create my-app --framework vite --skip-initWhat it does:
- Scaffolds a fresh Next.js or Vite project using bundled, tested templates
- Initializes Vayu UI automatically (unless
--skip-init) - Adds starter components:
Button,Typography,Select,useLocalStorage,useDebounce,useOnClickOutside, plus their required hooks and utilities - Installs all npm dependencies automatically
Flags:
| Flag | Description |
|---|---|
--framework <next|vite> | Framework to scaffold (default: next) |
--package-manager <npm|pnpm|yarn|bun> | Package manager (default: auto-detect) |
--app-router | Use App Router (Next.js only, default: true) |
--no-app-router | Use Pages Router (Next.js only) |
--typescript | Use TypeScript (default: true) |
--no-typescript | Use JavaScript |
--tailwind | Include Tailwind CSS (default: true) |
--no-tailwind | Skip Tailwind CSS |
--eslint | Include ESLint (default: true) |
--no-eslint | Skip ESLint |
--src-dir | Use src/ directory (default: true) |
--no-src-dir | Don't use src/ directory |
--skip-init | Skip Vayu UI initialization after scaffolding |
--skip-install | Skip npm install during scaffolding |
--force | Skip all prompts, use defaults |
vayu-ui init
Sets up Vayu UI in your project. Creates the folder structure, injects design tokens as CSS, and optionally installs Tailwind CSS v4.
npx vayu-ui-cli@latest initWhat it does:
- Detects your framework (Next.js, Vite, CRA, or generic)
- Creates
ui/components/,ui/hooks/,ui/utils/(insidesrc/if it exists) - Creates
vayu-ui-tokens.csswith all design tokens next to your main CSS - Adds
@importto your existing CSS file - Prompts to install Tailwind CSS v4 if not found
- Creates
vayu-ui.config.jsonto track paths and installed items
Flags:
| Flag | Description |
|---|---|
--path <dir> | Custom path for the ui/ folder (default: auto-detect src/ui or ui) |
--css-path <file> | Custom path for the main CSS file |
--merge | Merge tokens into existing CSS instead of creating a separate file |
--skip-tailwind | Skip Tailwind CSS installation check |
--force | Skip all prompts and use defaults |
npx vayu-ui-cli@latest init --mergenpx vayu-ui-cli@latest init --path src/lib/uinpx vayu-ui-cli@latest init --skip-tailwindvayu-ui list
Displays all 59 components and 34 hooks available in the Vayu UI registry, grouped by type and category.
npx vayu-ui-cli@latest listFlags:
| Flag | Description |
|---|---|
--type <component|hook> | Filter by item type |
--category <name> | Filter by category (e.g. inputs, state) |
npx vayu-ui-cli@latest list --type hooknpx vayu-ui-cli@latest list --type component --category overlaynpx vayu-ui-cli@latest list --category sensorvayu-ui add <slugs...>
Copies one or more components or hooks from the installed CLI release into your project. Automatically resolves transitive dependencies and installs required npm packages.
npx vayu-ui-cli@latest add buttonnpx vayu-ui-cli@latest add button modal tooltipnpx vayu-ui-cli@latest add use-debounce use-local-storageWhat it does:
- Looks up each slug in the registry
- Recursively resolves dependencies (e.g.
sidebar→tooltip) - Copies bundled source files
- Writes them into
{uiPath}/components/{Name}/or{uiPath}/hooks/ - Auto-includes the
cnutility (utils/index.ts) when adding any component - Installs npm packages (
clsx,tailwind-merge,lucide-react, etc.) - Records installed items in
vayu-ui.config.json
Flags:
| Flag | Short | Description |
|---|---|---|
--overwrite | -o | Overwrite existing files |
--dry-run | — | Preview what would be added without writing |
--skip-install | — | Skip npm dependency installation |
--yes | -y | Skip confirmation prompts |
npx vayu-ui-cli@latest add modal --dry-runnpx vayu-ui-cli@latest add button --overwritenpx vayu-ui-cli@latest add sidebar --skip-installAfter installing, import components from your ui folder:
import { Button } from '@/ui/components/Button';
import { useDebounce } from '@/ui/hooks/useDebounce';vayu-ui update [slugs...]
Refreshes installed components and hooks from the installed CLI release. Compares file contents and only overwrites changed files.
npx vayu-ui-cli@latest updatenpx vayu-ui-cli@latest update button modalFlags:
| Flag | Short | Description |
|---|---|---|
--force | -f | Overwrite changed files (the default update behavior) |
--dry-run | — | Preview what would be updated without writing files |
--css | — | Also update Vayu UI CSS design tokens |
npx vayu-ui-cli@latest update --dry-runnpx vayu-ui-cli@latest update --forcevayu-ui remove <slugs...>
Removes one or more installed components or hooks. Warns if other installed items depend on what you are removing. Auto-cleans utils/ when no components remain.
npx vayu-ui-cli@latest remove buttonnpx vayu-ui-cli@latest remove button modalFlags:
| Flag | Short | Description |
|---|---|---|
--force | -f | Skip confirmation prompt |
npx vayu-ui-cli@latest remove use-debounce --forcevayu-ui install-mcp
Configures the Vayu UI MCP server for AI coding tools. The server exposes 17 tools for component discovery, props, variants, scaffolding, and design tokens — so your AI assistant can work with Vayu UI natively.
No local installation needed — the server runs via npx vayu-ui-mcp using stdio transport.
npx vayu-ui-cli@latest install-mcpnpx vayu-ui-cli@latest install-mcp --tool claudenpx vayu-ui-cli@latest install-mcp --tool claude,cursor,vscodeSupported tools:
| Tool | Project-level config | Global config |
|---|---|---|
| Claude Code | .claude/settings.json | ~/.claude/settings.json |
| Cursor | .cursor/mcp.json | ~/.cursor/mcp.json |
| VS Code Copilot | .vscode/mcp.json | ~/.vscode/mcp.json |
| Windsurf | .windsurf/mcp.json | ~/.windsurf/mcp.json |
What it does:
- Detects or prompts for which AI tools to configure
- Writes the MCP server entry to each tool's config file
- Creates parent directories if needed
- Skips if already configured (use
--forceto overwrite)
Flags:
| Flag | Description |
|---|---|
--tool | Comma-separated: claude, cursor, vscode, windsurf |
--global | Write to home directory instead of project root |
--dry-run | Preview changes without writing |
--force | Skip prompts and overwrite existing entries |
npx vayu-ui-cli@latest install-mcp --globalnpx vayu-ui-cli@latest install-mcp --dry-runnpx vayu-ui-cli@latest install-mcp --tool claude --forceAfter running, restart your AI tool. The MCP server provides 17 tools including list_components, get_component_props, scaffold_component_usage, get_design_tokens, and more.
vayu-ui version
Shows the current CLI version, platform, and Node.js version.
npx vayu-ui-cli@latest versionnpx vayu-ui-cli@latest vConfiguration
vayu-ui init creates a vayu-ui.config.json at your project root:
{
"version": 1,
"uiPath": "src/ui",
"cssFile": "src/app/globals.css",
"tokensFile": "src/app/vayu-ui-tokens.css",
"installed": {
"button": {
"type": "component",
"installedAt": "2026-04-19T12:00:00.000Z"
}
}
}The CLI uses this file to:
- Know where to write files when you run
add - Track which items are installed for
updateandremove - Store your CSS file path for token injection
Folder Structure
After running vayu-ui init, your project gets a ui/ folder (or src/ui/ if you use a src/ directory):
src/ui/
├── components/
│ ├── Button/
│ │ ├── Button.tsx
│ │ ├── ButtonIcon.tsx
│ │ ├── ButtonBadge.tsx
│ │ ├── ButtonText.tsx
│ │ ├── types.ts
│ │ └── index.ts
│ └── Modal/
│ └── ...
├── hooks/
│ ├── useDebounce.ts
│ └── useLocalStorage.ts
└── utils/
└── index.ts # cn() utility (clsx + tailwind-merge)This structure mirrors the internal packages/ui/src/ layout, so relative imports between files (like ../../utils) work without any path aliases.
Stable source generation and workspaces
The CLI ships its component sources with the package. add and update use the same source dependency graph, including shared utilities. Updating to another release means running npx vayu-ui-cli@latest update. Local changes can be overwritten by update; preview with --dry-run first.
npx vayu-ui-cli@latest add --all --yes
npx vayu-ui-cli@latest add modal --cwd apps/web --yes
npx vayu-ui-cli@latest update --dry-run
npx vayu-ui-cli@latest update --css
npx vayu-ui-cli@latest remove modal --dry-run
npx vayu-ui-cli@latest create workspace --framework next --turbo
npx vayu-ui-cli@latest create workspace --framework vite --turbo --package-manager pnpm--turbo creates apps/web, a shared packages/ui source package, workspace manifests, Turbo tasks, and CSS scanning for the shared sources. Next.js transpiles @repo/ui; both framework starters import its exported component paths.
--skip-install writes complete dependencies and configuration without running a package manager. Run your package manager's install command once when ready. --no-typescript creates JavaScript application files; copied Vayu primitives remain TypeScript, which both supported bundlers compile. --no-src-dir, --no-eslint, --no-tailwind, and --no-app-router are supported. Without Tailwind, Vayu's utility classes require your own styling setup.
Custom folder layouts
All configured paths are relative to the directory containing vayu-ui.config.json. The nearest config is used when executing from a nested directory; --cwd selects another project. A workspace root can own a shared package:
{
"$schema": "https://vayu.design/schema/config.json",
"version": 1,
"uiPath": "packages/ui/src",
"packagePath": "packages/ui",
"aliases": {
"components": "@repo/ui/components",
"hooks": "@repo/ui/hooks"
},
"cssFile": "apps/web/src/app/globals.css",
"tokensFile": "packages/ui/src/styles.css",
"installed": {}
}For an existing app with separate directories, set paths.components, paths.hooks, and paths.utils, for example src/components/ui, src/hooks, and src/lib/vayu. The CLI rewrites relative source imports between those locations. packagePath selects the package receiving npm dependencies. aliases describe existing resolver aliases for MCP import guidance; they do not create TypeScript or bundler aliases.
Paths cannot escape the config directory. Put a shared workspace config at the workspace root instead of using ../ to target another package.