mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-10-29 06:47:26 +03:00 
			
		
		
		
	| Co-authored-by: Andrew Tatomyr <andrew.tatomyr@redocly.com> Co-authored-by: Alex Varchuk <olexandr.varchuk@gmail.com> Co-authored-by: Anastasiia Derymarko <anastasiia@redocly.com> | ||
|---|---|---|
| .. | ||
| __test__/build/configRedoc | ||
| .npmignore | ||
| Dockerfile | ||
| index.ts | ||
| npm-shrinkwrap.json | ||
| package.json | ||
| README.md | ||
| template.hbs | ||
redoc-cli
ReDoc's Command Line Interface
Installation
You can use redoc-cli by installing the package globally,
or using npx.
Usage
The two following commands are available:
- redoc-cli serve [spec]- starts the server with- specrendered with ReDoc. Supports a server-side rendering mode (- --ssr) and can watch the spec (- --watch) to automatically reload the page whenever it changes.
 Deprecated. Use- npx @redocly/openapi-cli preview-docs [spec]
- redoc-cli bundle [spec]- bundles- specand Redoc into a zero-dependency HTML file.
 Deprecated. Use Use "build" command instead.
- redoc-cli build [spec]- build- specand Redoc into a zero-dependency HTML file.
Some examples:
- Bundle with the main color changed to orange:
 $ redoc-cli build [spec] --options.theme.colors.primary.main=orange
- Serve with the nativeScrollbarsoption set to true:
 $ redoc-cli serve [spec] --options.nativeScrollbars
- Bundle using a custom Handlebars template
(check the default template for an example):
 $ redoc-cli build [spec] -t custom.hbs
- Bundle using a custom template and add custom templateOptions:
 $ redoc-cli build [spec] -t custom.hbs --templateOptions.metaDescription "Page meta description"
With a Redocly configuration file (more info):
- Go to folder with your Redocly configuration file (.redocly.yamlorredocly.yaml) and your OpenAPI definition file.
- Build the site using the buildcommand (options from the Redocly configuration file will be automatically fetched):
 redoc build openapi.yaml
For more details, run redoc-cli --help.