mirror of
https://github.com/Redocly/redoc.git
synced 2025-10-24 20:41:01 +03:00
* Add templateOptions param to pass additional data to custom template * Update README for ReDoc cli |
||
|---|---|---|
| .. | ||
| .npmignore | ||
| Dockerfile | ||
| index.ts | ||
| package.json | ||
| README.md | ||
| template.hbs | ||
| yarn.lock | ||
redoc-cli
ReDoc's Command Line Interface
Installation
You can use redoc cli by installing redoc-cli globally or using npx.
Usage
Two following commands are available:
redoc-cli serve [spec]- starts the server withspecrendered with ReDoc. Supports SSR mode (--ssr) and can watch the spec (--watch)redoc-cli bundle [spec]- bundles spec and ReDoc into zero-dependency HTML file.
Some examples:
- Bundle with main color changed to
orange:
$ redoc-cli bundle [spec] --options.theme.colors.primary.main=orange - Serve with
nativeScrollbarsoption set to true:
$ redoc-cli serve [spec] --options.nativeScrollbars - Bundle using custom template (check default template for reference):
$ redoc-cli bundle [spec] -t custom.hbs - Bundle using 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.