mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-25 01:53:44 +03:00
eb096b69be
Co-authored-by: Roman Hotsiy <gotsijroman@gmail.com> |
||
---|---|---|
.. | ||
.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 withspec
rendered with ReDoc. Supports a server-side rendering mode (--ssr
), and can watch the spec (--watch
) to automatically reload the page whenever it changes.redoc-cli bundle [spec]
- bundlesspec
and ReDoc into a zero-dependency HTML file.
Some examples:
- Bundle with the main color changed to
orange
:
$ redoc-cli bundle [spec] --options.theme.colors.primary.main=orange
- Serve with the
nativeScrollbars
option set to true:
$ redoc-cli serve [spec] --options.nativeScrollbars
- Bundle using a custom Handlebars template
(check the default template for an example):
$ redoc-cli bundle [spec] -t custom.hbs
- Bundle using a custom template and add custom
templateOptions
:
$ redoc-cli bundle [spec] -t custom.hbs --templateOptions.metaDescription "Page meta description"
For more details, run redoc-cli --help
.