New
You're viewing older docs for version 6.3. View latest docs

CLI options

Storybook comes with two CLI utilities: start-storybook and build-storybook.

Pass these commands the following options to alter Storybook's behavior.

start-storybook

Loading...
OptionsDescriptionExample
--helpOutput usage informationstart-storybook --help
-V, --versionOutput the version numberstart-storybook -V
-p, --port [number]Port to run Storybookstart-storybook -p 9009
-h, --host [string]Host to run Storybookstart-storybook -h my-host.com
-s, --static-dir <dir-names>Directory where to load static files from, comma-separated liststart-storybook -s public
-c, --config-dir [dir-name]Directory where to load Storybook configurations fromstart-storybook -c .storybook
--httpsServe Storybook over HTTPS. Note: You must provide your own certificate information.start-storybook --https
--ssl-ca <ca>Provide an SSL certificate authority. (Optional with --https, required if using a self-signed certificate)start-storybook --ssl-ca my-certificate
--ssl-cert <cert>Provide an SSL certificate. (Required with --https)start-storybook --ssl-cert my-ssl-certificate
--ssl-key <key>Provide an SSL key. (Required with --https)start-storybook --ssl-key my-ssl-key
--smoke-testExit after successful startstart-storybook --smoke-test
--ciCI mode (skip interactive prompts, don't open browser)start-storybook --ci
--quietSuppress verbose build outputstart-storybook --quiet
--no-dllDo not use dll reference (no-op)start-storybook --no-dll
--debug-webpackDisplay final webpack configurations for debugging purposesstart-storybook --debug-webpack
--webpack-stats-json <directory>Write Webpack Stats JSON to diskstart-storybook --webpack-stats-json /tmp/webpack-stats
--docsStarts Storybook in documentation mode. Learn more about it in herestart-storybook --docs
--no-manager-cacheDisables Storybook's manager caching mechanism. See note below.start-storybook --no-manager-cache
💡 NOTE: The flag --no-manager-cache disables the internal caching of Storybook and can severely impact your Storybook loading time, so only use it when you need to refresh Storybook's UI, such as when editing themes.

build-storybook

Loading...
OptionsDescriptionExample
-h, --helpOutput usage informationbuild-storybook --help
-V, --versionOutput the version numberbuild-storybook -V
-s, --static-dir <dir-names>Directory where to load static files from, comma-separated listbuild-storybook -s public
-o, --output-dir [dir-name]Directory where to store built filesbuild-storybook -o /my-deployed-storybook
-c, --config-dir [dir-name]Directory where to load Storybook configurations frombuild-storybook -c .storybook
-w, --watchEnables watch modebuild-storybook -w
--loglevel [level]Controls level of logging during build. Can be one of: [silly, verbose, info (default), warn, error, silent]build-storybook --loglevel warn
--quietSuppress verbose build outputbuild-storybook --quiet
--no-dllDo not use dll reference (no-op)build-storybook --no-dll
--debug-webpackDisplay final webpack configurations for debugging purposesbuild-storybook --debug-webpack
--webpack-stats-json <directory>Write Webpack Stats JSON to diskbuild-storybook --webpack-stats-json /my-storybook/webpack-stats
--docsBuilds Storybook in documentation mode. Learn more about it in here)build-storybook --docs
💡 NOTE: If you're using npm instead of yarn to publish Storybook, the commands work slightly different. For example, npm run build-storybook -- -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,565 developers and counting
WhyWhy StorybookComponent-driven UI
DocsGuidesTutorialsChangelogTelemetryStatus
CommunityAddonsGet involvedBlog
ShowcaseExploreProjectsComponent glossary
Open source software
Storybook

Maintained by
Chromatic
Special thanks to Netlify and CircleCI