New
Storybook’s Visual Tests addon enters betaVisual test with Chromatic
Star82,133
New
You're viewing older docs for version 7.0. View latest docs

CLI options

The Storybook command line interface (CLI) is the main tool you use to build and develop Storybook.

Storybook collects completely anonymous data to help us improve user experience. Participation is optional, and you may opt-out if you'd not like to share any information.

API commands

All of the following documentation is available in the CLI by running storybook --help.

dev

Compiles and serves a development build of your Storybook that reflects your source code changes in the browser in real time. Should be run from the root of your project.

Terminal
Loading...

Options include:

OptionDescription
--helpOutput usage information
storybook dev --help
-V, --versionOutput the version number
storybook dev -V
-p, --port [number]Port to run Storybook
storybook dev -p 9009
-h, --host [string]Host to run Storybook
storybook dev -h my-host.com
-s, --static-dirDeprecated see note. Directory where to load static files from, comma-separated list
storybook dev -s public
-c, --config-dir [dir-name]Directory where to load Storybook configurations from
storybook dev -c .storybook
--httpsServe Storybook over HTTPS. Note: You must provide your own certificate information
storybook dev --https
--ssl-caProvide an SSL certificate authority. (Optional with --https, required if using a self-signed certificate)
storybook dev --ssl-ca my-certificate
--ssl-certProvide an SSL certificate. (Required with --https)
storybook dev --ssl-cert my-ssl-certificate
--ssl-keyProvide an SSL key. (Required with --https)
storybook dev --ssl-key my-ssl-key
--smoke-testExit after successful start
storybook dev --smoke-test
--ciCI mode (skip interactive prompts, don't open browser)
storybook dev --ci
--no-openDo not open Storybook automatically in the browser
storybook dev --no-open
--quietSuppress verbose build output
storybook dev --quiet
--debug-webpackDisplay final webpack configurations for debugging purposes
storybook dev --debug-webpack
--webpack-stats-jsonWrite Webpack Stats JSON to disk
storybook dev --webpack-stats-json /tmp/webpack-stats
--docsStarts Storybook in documentation mode. Learn more about it in here
storybook dev --docs
--disable-telemetryDisables Storybook's telemetry. Learn more about it here
storybook dev --disable-telemetry

💡 Starting in 6.4 the -s flag is deprecated. Instead, use a configuration object in your .storybook/main.js file. See the images and assets documentation for more information.

build

Compiles your Storybook instance so it can be deployed. Should be run from the root of your project.

Terminal
Loading...

Options include:

OptionDescription
-h, --helpOutput usage information
storybook build --help
-V, --versionOutput the version number
storybook build -V
-s, --static-dirDeprecated see note.
Directory where to load static files from, comma-separated list
storybook build -s public
-o, --output-dir [dir-name]Directory where to store built files
storybook build -o /my-deployed-storybook
-c, --config-dir [dir-name]Directory where to load Storybook configurations from
storybook build -c .storybook
--loglevel [level]Controls level of logging during build.
Available options: silly, verbose, info (default), warn, error, silent
storybook build --loglevel warn
--quietSuppress verbose build output
storybook build --quiet
--debug-webpackDisplay final webpack configurations for debugging purposes
storybook build --debug-webpack
--webpack-stats-jsonWrite Webpack Stats JSON to disk
storybook build --webpack-stats-json /my-storybook/webpack-stats
--docsBuilds Storybook in documentation mode. Learn more about it in here
storybook build --docs
--disable-telemetryDisables Storybook's telemetry. Learn more about it here.
storybook build --disable-telemetry
💡 If you're using npm instead of yarn to publish Storybook, the commands work slightly different. For example, npm run storybook build -- -o ./path/to/build.

Was this page helpful?

Markdown accepted ([link text](url), _italic_, **bold**, etc). Your anonymous feedback will be posted publicly on GitHub.

✍️ Edit on GitHub – PRs welcome!
Storybook
Join the community
6,517 developers and counting
WhyWhy StorybookComponent-driven UI
Open source software
Storybook

Maintained by
Chromatic
Special thanks to Netlify and CircleCI