CLI Reference
Complete reference for the shadcn CLI commands used with ComponentVault.
CLI Reference
ComponentVault uses the standard shadcn CLI for component installation. This guide covers all commands and options.
Commands
add
Install a component from the registry:
npx shadcn@latest add https://registry.example.com/[component]Options:
| Option | Description |
|---|---|
--token | License key for premium components |
--overwrite | Overwrite existing files |
--cwd | Working directory (default: current) |
--path | Custom installation path |
Examples:
# Install a free component
npx shadcn@latest add https://registry.example.com/animated-card
# Install a premium component with license
npx shadcn@latest add https://registry.example.com/data-table-pro \
--token cv_abc123
# Overwrite existing component
npx shadcn@latest add https://registry.example.com/animated-card \
--overwriteinit
Initialize shadcn in your project (required before using components):
npx shadcn@latest initThis sets up:
- Tailwind CSS configuration
- CSS variables for theming
- Utility functions in
lib/utils.ts - Component configuration in
components.json
diff
Check for updates to installed components:
npx shadcn@latest diffThe diff command shows changes between your local components and the registry versions.
Configuration
components.json
The CLI uses a components.json file for configuration:
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "app/globals.css",
"baseColor": "slate",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}Environment Variables
For premium components, you can set your license key as an environment variable:
export SHADCN_TOKEN=cv_your_license_keyThen install without the --token flag:
npx shadcn@latest add https://registry.example.com/data-table-proTroubleshooting
Component not found
Make sure you're using the correct registry URL:
# Correct
npx shadcn@latest add https://registry.example.com/animated-card
# Wrong - missing https://
npx shadcn@latest add registry.example.com/animated-cardPermission denied
For premium components, ensure your license key is valid and has access to the component.
Dependency conflicts
If you encounter dependency conflicts, try installing the dependencies manually:
npm install framer-motionThen run the add command again with --overwrite.