Files
redocly-cli/docs/commands/index.md
Lorna Jane Mitchell 9dc78a6d3f docs: Improve CLI usage wording (#1162)
* chore: Tidy up usage options and wording

* docs: Update/refresh command docs pages, add completion page

* chore: run prettier

* fix: keep the previous push command format for backward compatibility

* fix: update test snapshots to match new usage output

* chore: run prettier

* Apply suggestions from code review

Co-authored-by: Heather Cloward <heathercloward@gmail.com>

---------

Co-authored-by: Heather Cloward <heathercloward@gmail.com>
2023-07-12 10:30:05 +01:00

2.0 KiB

tocMaxDepth
tocMaxDepth
2

Redocly CLI commands

Documentation commands:

  • preview-docs Preview API reference docs for the specified definition.
  • build-docs Build definition into an HTML file.

API management commands:

  • stats Gathering statistics for a document.
  • bundle Bundle definition.
  • split Split definition into a multi-file structure.
  • join Join definitions [experimental feature].

Linting commands:

  • lint Lint definition.

Redocly platform commands:

  • login Login to the Redocly API registry with an access token.
  • logout Clear your stored credentials for the Redocly API registry.
  • push Push an API definition to the Redocly API registry.

Supporting commands:

  • completion Generate autocomplete commands (includes install instructions).

Additional options

There are some parameters supported by all commands:

--version displays the current version of redocly.

--help displays the command help, or the help for the subcommand if you used one. For example:

redocly lint --help

Try these with any of the other commands.

Config file

Redocly CLI comes with one primary configuration file (redocly.yaml), also known as the Redocly configuration file. This file defines all of the config options available to you, including the location of your files (for unbundling and bundling), and linting rules (for validation against the OpenAPI Specification).

The Redocly configuration file must sit in your root directory. If Redocly CLI finds redocly.yaml in the root directory, it uses the options set in that file when executing commands.

You can also specify a config file to most commands using --config myconfig.yaml as part of the command. For example:

redocly lint --config redocly-official.yaml openapi.yaml

For more information, refer to the Redocly configuration file docs.