LLM-first developer tool for generating Component Catalogues
The catalogue CLI provides commands for developing, building, and testing your component catalogue.
npm install @clearforest/catalogue-cli
Initialize a new component catalogue in the current directory.
catalogue init [options]
| Option | Description |
|---|---|
-n, --name <name> |
Project name |
-f, --force |
Overwrite existing files |
--with-claude |
Install Claude Code skills |
Examples:
# Initialize with defaults
catalogue init
# With custom name
catalogue init --name "My Design System"
# Force overwrite existing config
catalogue init --force
Creates:
├── catalogue.config.ts
├── tsconfig.json
├── .gitignore
├── registry/
│ └── components/
│ └── sample-button/
│ ├── component.json
│ ├── docs.md
│ └── scenarios/
│ └── default.json
├── src/
│ └── components/
│ ├── index.ts
│ └── sample-button.ts
└── screenshots/
With --with-claude, also creates:
├── .claude/
│ └── skills/
│ ├── new-component.md
│ ├── new-scenario.md
│ └── document-component.md
When initialized with --with-claude, these skills are available:
| Skill | Description |
|---|---|
/new-component <id> |
Create a new component with registry files and source |
/new-scenario <id> <name> |
Add a scenario to an existing component |
/document-component <id> |
Generate documentation from source code |
/migrate-library [path] |
Migrate an existing component library |
/setup-tokens [path] |
Configure design tokens and themes |
Start the development server with hot reload.
catalogue dev [options]
| Option | Description |
|---|---|
-c, --config <file> |
Path to config file |
-p, --port <port> |
Port to listen on (default: 5173) |
Examples:
# Start with defaults
catalogue dev
# Custom port
catalogue dev --port 3000
# Custom config
catalogue dev --config ./custom.config.ts
Build the static catalogue site.
catalogue build [options]
| Option | Description |
|---|---|
-c, --config <file> |
Path to config file |
-o, --out-dir <dir> |
Output directory |
Examples:
# Build with defaults
catalogue build
# Custom output directory
catalogue build --out-dir ./public/docs
Output:
Creates a static site in the output directory that can be deployed to any static host.
Preview the built catalogue locally.
catalogue preview [options]
| Option | Description |
|---|---|
-c, --config <file> |
Path to config file |
-p, --port <port> |
Port to listen on (default: 5173) |
Examples:
# Build then preview
catalogue build
catalogue preview
Validate the component registry.
catalogue validate [options]
| Option | Description |
|---|---|
-c, --config <file> |
Path to config file |
Checks:
primaryScenarioId existsparentId references valid componentsubcomponents reference valid componentsExamples:
# Validate registry
catalogue validate
Output:
Validating registry...
Found 5 component(s), 12 scenario(s), 2 example(s)
✓ Registry is valid
Or with errors:
Validating registry...
Schema validation errors:
components/button/component.json: status: Invalid enum value
Cross-reference validation errors:
components/card/component.json: playground.primaryScenarioId:
Primary scenario "card-missing" not found
✗ Validation failed
Run Playwright visual regression tests.
catalogue test [options]
| Option | Description |
|---|---|
-c, --config <file> |
Path to config file |
-u, --update |
Update snapshots |
--headed |
Run tests in headed mode |
Process:
Examples:
# Run tests
catalogue test
# Update snapshots
catalogue test --update
# Debug in browser
catalogue test --headed
Prerequisites:
# Install Playwright browsers
npx playwright install
Create a new component with scaffolding.
catalogue new <component-id> [options]
| Option | Description |
|---|---|
-c, --config <file> |
Path to config file |
-t, --title <title> |
Component title |
-s, --status <status> |
Status: stable, beta, deprecated |
-k, --kind <kind> |
Kind: standalone, subcomponent, feature |
Examples:
# Basic component
catalogue new user-avatar
# With all options
catalogue new data-table \
--title "Data Table" \
--status stable \
--kind standalone
# Subcomponent
catalogue new table-row --kind subcomponent
Creates:
registry/components/<id>/
├── component.json
├── docs.md
└── scenarios/
└── default.json
src/components/
└── <id>.ts
All commands support:
| Option | Description |
|---|---|
-h, --help |
Show help for command |
-v, --version |
Show version number |
catalogue --help
catalogue dev --help
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (validation failed, build error, etc.) |
Commands look for configuration in this order:
--config option pathcatalogue.config.tscatalogue.config.jscatalogue.config.mjsAdd to package.json:
{
"scripts": {
"catalogue": "catalogue dev",
"catalogue:build": "catalogue build",
"catalogue:test": "catalogue test",
"catalogue:validate": "catalogue validate"
}
}
Then run:
npm run catalogue
npm run catalogue:build
name: Component Catalogue
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '23'
- run: npm ci
- run: npx catalogue validate
visual-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '23'
- run: npm ci
- run: npx playwright install --with-deps
- run: npx catalogue test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/