CLI Reference
The Sigil CLI bootstraps projects, converts existing apps, installs components, manages presets, and validates setup.
Installation
For raw one-off usage, call the scoped package:
npx @sigil-ui/cli <command> [options]
pnpm dlx @sigil-ui/cli <command> [options]After installing the CLI locally, the shorter sigil binary is available:
pnpm add -D @sigil-ui/cli
pnpm sigil doctorCommands
convert
Convert an existing project to Sigil end-to-end.
npx @sigil-ui/cli convert [options]| Option | Description | Default |
|---|---|---|
-p, --preset <name> | Preset to use | sigil |
-d, --dir <dir> | Components directory | src/components/ui when src/ exists |
-y, --yes | Skip prompts | false |
--no-agent | Skip .sigil/AGENTS.md and agent assets | false |
--no-install | Update package.json but skip package install | false |
--no-inject-css | Skip global CSS token import injection | false |
--dry-run | Print planned changes without writing files | false |
--overwrite | Replace an existing sigil.config.ts | false |
npx @sigil-ui/cli convert
npx @sigil-ui/cli convert --preset noir --no-installinit
Create Sigil config, token CSS, optional starter components, and agent instructions. Use convert when you want the CLI to also update dependencies and inject the global CSS import by default.
npx @sigil-ui/cli init [options]| Option | Description | Default |
|---|---|---|
-p, --preset <name> | Preset to use | sigil |
-d, --dir <dir> | Components directory | src/components/ui when src/ exists |
-y, --yes | Skip prompts | false |
--no-agent | Skip agent instructions | false |
--install | Install dependencies after writing files | false |
--inject-css | Inject token import into detected global CSS | false |
--dry-run | Print planned changes without writing files | false |
What it does:
- Writes
sigil.config.ts - Writes token CSS that imports
@sigil-ui/tokens/cssand a preset - Creates the configured components directory
- Optionally creates
.sigil/AGENTS.mdand installs Sigil agent assets - Prints dependency and next-step guidance
npx @sigil-ui/cli init
npx @sigil-ui/cli init --preset cobalt --inject-cssadd
Copy token-driven component source into your app.
npx @sigil-ui/cli add button card input
npx @sigil-ui/cli add --all| Option | Description | Default |
|---|---|---|
-a, --all | Add all registered CLI components | false |
-o, --overwrite | Replace existing files | false |
-d, --dir <dir> | Override components directory | from sigil.config.ts |
preset
Browse, switch, or create presets.
npx @sigil-ui/cli preset
npx @sigil-ui/cli preset list
npx @sigil-ui/cli preset noir
npx @sigil-ui/cli preset creatediff
Compare your token CSS against the local .sigil/tokens.snapshot.css.
npx @sigil-ui/cli diff
npx @sigil-ui/cli diff syncThe first run creates a snapshot. Run diff sync after accepting intentional token changes.
doctor
Validate a Sigil project.
npx @sigil-ui/cli doctorChecks config, token CSS, component directory, component dependencies, global CSS import, preset validity, and installed Sigil agent assets.
New Projects
Use create-sigil-app for a fresh Next.js project:
npx create-sigil-app my-appRaw vs Local Invocation
Use npx @sigil-ui/cli ... or pnpm dlx @sigil-ui/cli ... when Sigil is not installed yet. Use sigil ... only after @sigil-ui/cli is installed in the project.
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Invalid setup or failing diagnostic |