init#
Initialize Sugarcoat in your project.
Options#
| Option | Alias | Description |
|---|---|---|
--yes | -y | Skip prompts and use defaults |
--force | -f | Force overwrite existing configuration |
What it does#
- Detects your project framework (Next.js, Vite, etc.)
- Prompts for theme preferences (brand color, accent color, gray scale)
- Creates
sugarcoat.config.tswith your settings - Creates
.sugarcoat/directory with Panda config - Creates or updates
postcss.config.js - Updates
.gitignoreto exclude generated files
Examples#
add#
Add components from the registry to your project.
Arguments#
| Argument | Description |
|---|---|
components | Component names to add (space-separated) |
Options#
| Option | Alias | Description |
|---|---|---|
--yes | -y | Skip confirmation prompts |
--force | -f | Force overwrite existing files |
--all | -a | Install all available components |
--path | -p | Custom path for components |
What it does#
- Fetches component data from the registry
- Resolves and installs registry dependencies
- Creates component files in your project
- Updates
components.jsonto track installed components - Lists any npm dependencies you need to install
Examples#
remove#
Remove components from your project.
Alias: sugarcoat rm
Arguments#
| Argument | Description |
|---|---|
components | Component names to remove (space-separated) |
Options#
| Option | Alias | Description |
|---|---|---|
--yes | -y | Skip confirmation prompts |
--force | -f | Force removal even if other components depend on it |
What it does#
- Checks for dependent components
- Removes component files from your project
- Updates
components.json
Examples#
update#
Update installed components to their latest registry versions.
Arguments#
| Argument | Description |
|---|---|
components | Component names to update (space-separated) |
Options#
| Option | Alias | Description |
|---|---|---|
--yes | -y | Skip confirmation prompts |
--all | -a | Update all installed components |
--dry-run | Show what would be updated without making changes |
What it does#
- Compares local files with registry versions
- Shows files that would be updated or created
- Overwrites local files with latest registry versions
Examples#
list#
List all available components in the registry.
Alias: sugarcoat ls
Options#
| Option | Alias | Description |
|---|---|---|
--category | -c | Filter by category |
--installed | Show only installed components |
Examples#
search#
Search for components in the registry.
Arguments#
| Argument | Description |
|---|---|
query | Search query string |
Options#
| Option | Alias | Description |
|---|---|---|
--limit | -l | Limit number of results (default: 10) |
Examples#
info#
Display detailed information about a component.
Arguments#
| Argument | Description |
|---|---|
component | Component name (required) |
Options#
| Option | Description |
|---|---|
--json | Output as JSON |
What it shows#
- Component name and description
- Installation status
- Categories and tags
- NPM dependencies
- Registry dependencies
- File list
Examples#
diff#
Show differences between local and registry versions of components.
Arguments#
| Argument | Description |
|---|---|
components | Component names to check (space-separated) |
Options#
| Option | Alias | Description |
|---|---|---|
--verbose | -v | Show detailed diff information |
What it shows#
- Components that are up to date
- Components with modified files
- Missing files
- Line count of changes (in verbose mode)
Examples#
codegen#
Generate CSS artifacts from your sugarcoat.config.ts.
Alias: sugarcoat gen
Options#
| Option | Alias | Description |
|---|---|---|
--watch | -w | Watch mode - regenerate on file changes |
What it generates#
css/- CSS utility functions (css,cx,cva)tokens/- Design tokenspatterns/- Layout patterns (stack, flex, grid, etc.)recipes/- Component recipesjsx/- JSX factory componentsstyles.css- Extracted CSS styles
Examples#
dev#
Run codegen in watch mode (alias for codegen --watch).
This is the recommended way to run Sugarcoat during development. It watches for file changes and regenerates CSS automatically.
Example#
doctor#
Run diagnostics to check your Sugarcoat setup.
Options#
| Option | Alias | Description |
|---|---|---|
--verbose | -v | Show detailed output |
What it checks#
- Project - package.json exists
- Framework - Detected framework and settings
- Sugarcoat config -
sugarcoat.config.tsexists - Sugarcoat directory -
.sugarcoat/exists - Panda config -
.sugarcoat/panda.config.tsexists - Generated artifacts - Files in
.sugarcoat/generated/ - CSS output -
styles.cssexists and size - Dependencies - Required packages installed
- PostCSS config - Properly configured
- TypeScript paths -
@/.sugarcoatalias configured - Components config -
components.jsonstatus
Examples#
mcp#
Start or configure the MCP (Model Context Protocol) server for AI assistants.
Options#
| Option | Description |
|---|---|
--install <client> | Install MCP config for: claude, cursor, vscode |
What it does#
Without options, starts the MCP server (used by AI assistants).
With --install, creates the appropriate MCP configuration file:
- claude: Creates
.mcp.jsonin project root - cursor: Creates
.cursor/mcp.json - vscode: Creates
.vscode/mcp.json
Examples#
See the AI Integration documentation for detailed setup instructions.