Skip to content

@storyshelf/cli

View as Markdown

User guide: For step-by-step CLI usage with examples, see the CLI guide.

@storyshelf/cli provides the storyshelf binary for CI pipelines. It is client-only — no Playwright, no server dependencies, installs cleanly in CI.

Terminal window
npm i storyshelf

or

Terminal window
npm install -g storyshelf

Client config written to .storybook/storyshelf.json:

{
"slug": "string (required)",
"url": "string (optional)",
"buildDir": "string (default: storybook-static)",
"buildCommand": "string (optional, mutually exclusive with buildScriptName)",
"buildScriptName": "string (default: build-storybook)",
"skip": "string (optional, glob pattern to skip upload)",
"affectedOnly": "boolean (default: true, render only impacted stories)",
"untraced": "string[] (optional, trace exclusions, union with --untraced)"
}

Validation: zod schema with refine for mutual exclusivity. Upload flags --full, --untraced, and --stats-file tune affected capture per run.

The CLI is designed for shell use. For programmatic access, use the REST API directly (/api/v1 endpoints) or the @storyshelf/core models.

The CLI talks to the server’s /api/v1 endpoints. To start the server, use storyshelf server init to scaffold a new project, or see the Deployment guide.