CLI Commands
CapsuleUI provides a simple CLI to manage your components and project setup. All commands are prefixed with npx capsule.
Commands
npx @zizigy/capsule init
Initializes CapsuleUI in your project. Creates the @capsule folder with global styles and utilities.
Usage:
npx @zizigy/capsule initOptions:
-d, --dir <directory>- Base directory where@capsulewill be created (default: project root)
Example:
# Initialize in project root
npx @zizigy/capsule init
# Initialize in src directory
npx @zizigy/capsule init -d srcWhat it does:
- Creates
@capsulefolder structure - Copies global styles and utilities
- Sets up component registry
npx @zizigy/capsule add <component>
Adds a component to your project from the available templates.
Usage:
npx @zizigy/capsule add <component-name>Options:
-p, --prefix <prefix>- Custom element prefix (default:capsule)
Examples:
# Add a Button component with default prefix
npx @zizigy/capsule add Button
# Add a Button component with custom prefix
npx @zizigy/capsule add Button --prefix ui
# Add multiple components
npx @zizigy/capsule add Button
npx @zizigy/capsule add Alert
npx @zizigy/capsule add AccordionWhat it does:
- Copies component files from templates
- Replaces
__PREFIX__and__COMPONENT__placeholders - Renames files to match your prefix (e.g.,
capsule-button.js) - Imports CSS files into global styles
- Imports JavaScript files into components index
- Updates VS Code settings if needed
npx @zizigy/capsule list
Lists all available components that can be added to your project.
Usage:
npx @zizigy/capsule listExample output:
Available components:
- Accordion
- Alert
- Autocomplete
- Badge
- Breadcrumb
- Button
- ButtonGroup
- Chip
- Divider
- Pagination
- Range
- Rating
- ScrollArea
- Skeleton
- Stepper
- Switch
- Tabs
- Tooltipnpx @zizigy/capsule module <action> [name]
Manages modules in your project (like form validation utilities).
Usage:
npx @zizigy/capsule module <action> [name]Actions:
add <name>- Add a module to your projectremove <name>- Remove a module from your projectlist- List all available modules
Examples:
# List available modules
npx @zizigy/capsule module list
# Add a specific module
npx @zizigy/capsule module add form
# Remove a module
npx @zizigy/capsule module remove formAvailable modules:
form- Form validation utilities
npx @zizigy/capsule debug
Helps debug CapsuleUI installation and configuration issues.
Usage:
npx @zizigy/capsule debugWhat it does:
- Checks if
@capsulefolder exists - Validates component structure
- Shows current configuration
- Provides troubleshooting information
npx @zizigy/capsule vscode
Updates VS Code settings for better autocomplete and IntelliSense support.
Usage:
npx @zizigy/capsule vscodeWhat it does:
- Updates VS Code HTML custom data
- Enables IntelliSense for component attributes
- Improves autocomplete in VS Code
Global Options
All commands support these global options:
--help, -h- Display help for the command--version, -v- Display version number
Tips
- Always run
npx @zizigy/capsule initfirst in a new project - Use
npx @zizigy/capsule listto see all available components - Components are case-sensitive (use
Buttonnotbutton) - Custom prefixes must be lowercase and contain no special characters
