Skip to content
Last updated

Redocly CLI commands

Documentation commands:

  • preview Start a local preview of a Redocly project with one of the product NPM packages.
  • translate Generate translation keys for a Redocly Realm, Reef, or Revel project.
  • eject Eject and modify components from the core theme in a Redocly Realm, Reef, or Revel project.
  • build-docs Build an API description into an HTML file.

API management commands:

  • bundle Bundle an API description.
  • generate-client Generate a typed TypeScript client from an OpenAPI description [experimental feature].
  • eject-generator Copy a built-in client generator into your repository as an editable file [experimental feature].
  • join Join API descriptions [experimental feature].
  • score Score an API for integration simplicity and AI agent readiness.
  • split Split an API description into a multi-file structure.
  • stats Gather statistics for a document.

Linting commands:

Testing commands:

  • respect Execute API tests described in an Arazzo description.
  • generate-arazzo Generate an Arazzo description from an OpenAPI description.
  • drift Detect drift between recorded HTTP traffic and an OpenAPI description [experimental feature].
  • proxy Capture live HTTP traffic through a reverse proxy into a HAR file [experimental feature].
  • generate-spec Infer an OpenAPI description from recorded HTTP traffic [experimental feature].

Redocly platform commands:

  • login Log in to Reunite.
  • logout Clear your stored credentials.
  • push Push an API description to Reunite.
  • push-status Track an in-progress push operation to Reunite.

Supporting commands:

  • completion Generate autocomplete commands (includes install instructions).

Additional options

All commands support these parameters:

--version displays the current version of redocly.

--help displays the help for the command. If you used a subcommand, it displays the help for that subcommand. For example:

npx @redocly/cli@latest lint --help

Try these with any of the other commands.

Config file

Redocly CLI has one primary configuration file (redocly.yaml), also called the Redocly configuration file. This file defines all of the configuration options available to you. These options include the location of your files (for unbundling and bundling) and the linting rules (for validation against the OpenAPI Specification).

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

For most commands, you can also specify a configuration file with --config myconfig.yaml as part of the command. For example:

npx @redocly/cli@latest lint --config redocly-official.yaml openapi.yaml

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