DEV Community

Cover image for Apidog CLI vs Redocly CLI: which API CLI should you use?
Hassann
Hassann

Posted on • Originally published at apidog.com

Apidog CLI vs Redocly CLI: which API CLI should you use?

Both Apidog CLI and Redocly CLI live in your terminal, support OpenAPI workflows, and help teams automate API spec work. But they solve different problems: Redocly CLI is best for code-first linting, bundling, splitting, and docs generation; Apidog CLI is best when your OpenAPI spec also needs to connect to API design, mocks, test scenarios, reports, and project-based documentation.

Try Apidog today

This is a command-level comparison of the Apidog CLI and Redocly CLI. Redocly CLI is a strong open-source tool, especially for teams that treat OpenAPI files as source code. Apidog CLI fits better when API specs are part of a larger lifecycle that includes testing, mocking, and documentation.

TL;DR verdict

Use Redocly CLI when you want:

  • Open-source OpenAPI linting
  • Custom rulesets
  • Bundling and splitting specs
  • Static HTML docs from local files
  • A terminal-native workflow with no account required

Use Apidog CLI when you want:

  • Import/export against an Apidog project
  • OpenAPI, Postman, HAR, Insomnia, and other format support
  • CI API test execution
  • JUnit, HTML, JSON, and CLI reports
  • A platform workflow for design, mocks, tests, and docs

They can also work together: run Redocly CLI as your lint gate, then use Apidog for API collaboration, mocking, testing, and publishing.

Two different CLI models

Redocly CLI is file-first.

You run commands directly against local OpenAPI files:

redocly lint openapi.yaml
redocly bundle openapi.yaml
redocly build-docs openapi.yaml -o docs.html
Enter fullscreen mode Exit fullscreen mode

Configuration lives in redocly.yaml, which you commit with your spec. This works well when your OpenAPI Specification file is the source of truth and every change goes through pull requests.

Apidog CLI is project-first.

Most commands operate against an Apidog project using a project ID and access token:

apidog import --project 123456 --format openapi --file ./openapi.json
apidog export --project 123456 --format openapi --output ./openapi.json
apidog run --project 123456 -t <testScenarioId> -e <environmentId>
Enter fullscreen mode Exit fullscreen mode

That model works when your API definition lives in a shared workspace where teams design endpoints, generate mocks, run test scenarios, and publish docs.

Command-by-command comparison

Task Redocly CLI Apidog CLI
Validate / lint redocly lint with built-in or custom rulesets via redocly.yaml Validates structure on import; no standalone lint command
Bundle multi-file spec redocly bundle openapi.yaml apidog export ... --format openapi outputs a consolidated file
Split one file into many redocly split Not available
Join multiple files redocly join experimental Not available
Build static HTML docs redocly build-docs openapi.yaml -o docs.html apidog export ... --format html
Run API tests in CI Not available apidog run ... -r "cli,html,json,junit"
Mock server Not available Built into the Apidog app, not a CLI command
Custom lint rules Yes, configured in redocly.yaml No
CI test reports Not available Yes, via -r/--reporters
Open source Yes No, freemium

Where Redocly CLI is stronger

1. OpenAPI linting

Redocly CLI is built for linting API descriptions.

redocly lint openapi.yaml
Enter fullscreen mode Exit fullscreen mode

With redocly.yaml, you can enforce rulesets such as:

  • minimal
  • recommended
  • recommended-strict
  • spec
  • custom rules

Example redocly.yaml:

apis:
  main:
    root: ./openapi.yaml

extends:
  - recommended

rules:
  operation-operationId: error
  operation-summary: warn
  no-unused-components: error
Enter fullscreen mode Exit fullscreen mode

Apidog validates structure during import, but it does not provide:

  • apidog lint
  • custom CLI lint rules
  • redocly.yaml-style governance
  • terminal-native style guide enforcement

If your goal is OpenAPI governance as code, Redocly CLI is the better fit.

2. Local file workflows

Redocly CLI runs against files on disk. No login is required for common operations:

redocly lint openapi.yaml
redocly bundle openapi.yaml --output bundled.json
redocly split openapi.yaml --outDir ./split-spec
redocly build-docs openapi.yaml -o docs.html
Enter fullscreen mode Exit fullscreen mode

That matters when your CI pipeline needs to validate specs without external project access.

3. Split and join utilities

Redocly CLI includes utilities for restructuring OpenAPI files:

redocly split openapi.yaml --outDir ./split-spec
Enter fullscreen mode Exit fullscreen mode

It can also bundle references into one file:

redocly bundle openapi.yaml --output bundled.json
Enter fullscreen mode Exit fullscreen mode

Apidog can import multi-file specs and export a consolidated definition, but it does not provide standalone split/join commands for local files.

Where Apidog CLI is stronger

1. Project-based API lifecycle automation

Apidog CLI connects terminal automation to an Apidog project.

Install and log in:

npm install -g apidog-cli@latest
apidog login --with-token <TOKEN>
Enter fullscreen mode Exit fullscreen mode

The token is stored in:

~/.apidog/config.toml
Enter fullscreen mode Exit fullscreen mode

Do not print it in CI logs or commit it to your repository.

Import an OpenAPI file:

apidog import --project 123456 --format openapi --file ./openapi.json
Enter fullscreen mode Exit fullscreen mode

Export a consolidated OpenAPI file:

apidog export --project 123456 --format openapi --output ./openapi.json --oas-version 3.1
Enter fullscreen mode Exit fullscreen mode

Export HTML docs:

apidog export --project 123456 --format html --output ./docs.html
Enter fullscreen mode Exit fullscreen mode

This is useful when the spec needs to feed a shared workspace for design, mocks, tests, and documentation.

2. CI API test execution

Redocly CLI does not run API tests. Apidog CLI does.

Run a test scenario:

apidog run --project 123456 -t <testScenarioId> -e <environmentId> -r "cli,html,json,junit"
Enter fullscreen mode Exit fullscreen mode

This can produce reports for CI systems:

  • CLI output
  • HTML report
  • JSON report
  • JUnit XML report

You can also run from an exported collection file without a project or token:

apidog run ./collection.apidog-cli.json
Enter fullscreen mode Exit fullscreen mode

Useful flags include:

apidog run ./collection.apidog-cli.json \
  --out-dir ./reports \
  -r "cli,html,json,junit" \
  -n 3 \
  --env-var "baseUrl=https://api.example.com"
Enter fullscreen mode Exit fullscreen mode

See the Apidog CLI complete guide and the official Apidog CLI documentation for the full command reference.

3. More import formats

Apidog CLI can import more than OpenAPI, including:

  • Postman
  • HAR
  • Insomnia
  • JMeter
  • WSDL
  • YApi
  • RAP2
  • apiDoc
  • Hoppscotch
  • Markdown
  • JSON Schema
  • Apidog format

Example:

apidog import --project 123456 --format postman --file ./collection.json
Enter fullscreen mode Exit fullscreen mode

That makes Apidog more useful when your team is consolidating API assets from several tools.

Install and use Redocly CLI

Install globally:

npm install -g @redocly/cli@latest
Enter fullscreen mode Exit fullscreen mode

Or run without global installation:

npx @redocly/cli@latest lint openapi.yaml
Enter fullscreen mode Exit fullscreen mode

Lint a spec:

redocly lint openapi.yaml
Enter fullscreen mode Exit fullscreen mode

Bundle a multi-file spec:

redocly bundle openapi.yaml --output bundled.json
Enter fullscreen mode Exit fullscreen mode

Build standalone HTML docs:

redocly build-docs openapi.yaml -o docs.html
Enter fullscreen mode Exit fullscreen mode

Split a single OpenAPI file into multiple files:

redocly split openapi.yaml --outDir ./split-spec
Enter fullscreen mode Exit fullscreen mode

If you previously used swagger-cli, Redocly CLI is the named successor. Redocly provides a migration guide from swagger-cli, and the swagger-cli repo now includes a deprecation notice.

Common flag mappings:

swagger-cli Redocly CLI
-o, --outfile --output
-t, --type --ext
-r, --dereference -d, --dereferenced

For related tooling comparisons, see the OpenAPI linter setup guide and the Redocly alternatives roundup.

Install and use Apidog CLI

Install globally:

npm install -g apidog-cli@latest
Enter fullscreen mode Exit fullscreen mode

Authenticate with an access token from the Apidog app:

apidog login --with-token <TOKEN>
Enter fullscreen mode Exit fullscreen mode

Import an OpenAPI definition into a project:

apidog import --project 123456 --format openapi --file ./openapi.json
Enter fullscreen mode Exit fullscreen mode

Export OpenAPI from the project:

apidog export --project 123456 --format openapi --output ./openapi.json
Enter fullscreen mode Exit fullscreen mode

Export as OpenAPI 3.1:

apidog export --project 123456 --format openapi --output ./openapi.json --oas-version 3.1
Enter fullscreen mode Exit fullscreen mode

Export HTML documentation:

apidog export --project 123456 --format html --output ./docs.html
Enter fullscreen mode Exit fullscreen mode

Run an API test scenario in CI:

apidog run --project 123456 -t <testScenarioId> -e <environmentId> -r "cli,html,json,junit"
Enter fullscreen mode Exit fullscreen mode

Run offline from an exported collection:

apidog run ./collection.apidog-cli.json
Enter fullscreen mode Exit fullscreen mode

For more runner comparisons, see Apidog CLI vs Newman and Bruno CLI vs Apidog CLI.

When to choose Redocly CLI

Choose Redocly CLI if your API spec is source-controlled and you want to enforce quality before merge.

A typical CI step looks like this:

name: OpenAPI lint

on:
  pull_request:

jobs:
  lint-openapi:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run Redocly lint
        run: npx @redocly/cli@latest lint openapi.yaml
Enter fullscreen mode Exit fullscreen mode

Use Redocly CLI when you need:

  • custom OpenAPI lint rules
  • repo-based API governance
  • no account or project dependency
  • local bundling
  • static docs generation
  • split/join workflows

The full command set is available in the Redocly CLI docs and the @redocly/cli npm package page.

When to choose Apidog CLI

Choose Apidog CLI when the spec is only one part of the workflow and you also need testing, mocks, and docs around it.

A typical CI test step looks like this:

name: API tests

on:
  push:

jobs:
  api-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Apidog CLI
        run: npm install -g apidog-cli@latest

      - name: Login to Apidog
        run: apidog login --with-token "${{ secrets.APIDOG_TOKEN }}"

      - name: Run API tests
        run: |
          apidog run \
            --project 123456 \
            -t <testScenarioId> \
            -e <environmentId> \
            -r "cli,html,json,junit" \
            --out-dir ./reports
Enter fullscreen mode Exit fullscreen mode

Use Apidog when you need:

  • API test execution in CI
  • JUnit/HTML/JSON reports
  • import/export across multiple API formats
  • a shared API project for designers, developers, testers, and writers
  • mocks and documentation connected to the same API definition

The patterns in OpenAPI validation in CI fit naturally with Apidog test runs.

You can Download Apidog to follow along. It’s free to start, no credit card required.

Recommended combined workflow

You do not have to choose only one.

A practical setup is:

  1. Keep openapi.yaml in git.
  2. Run Redocly CLI in pull requests.
  3. Block merges when linting fails.
  4. Import the approved spec into Apidog.
  5. Use Apidog for mocks, test scenarios, docs, and CI test execution.

Example:

# 1. Lint locally or in CI
redocly lint openapi.yaml

# 2. Bundle if needed
redocly bundle openapi.yaml --output bundled.json

# 3. Import into Apidog
apidog import --project 123456 --format openapi --file ./bundled.json

# 4. Run API tests
apidog run --project 123456 -t <testScenarioId> -e <environmentId> -r "cli,html,json,junit"
Enter fullscreen mode Exit fullscreen mode

This keeps Redocly focused on spec governance and Apidog focused on lifecycle automation.

FAQ

Does Apidog CLI have a lint command with custom rules like Redocly?

No. Apidog validates a definition’s structure during import, but there is no apidog lint command and no custom CLI ruleset system. For configurable code-first linting, use Redocly CLI or Spectral.

Can Redocly CLI run API tests in CI?

No. Redocly CLI lints, bundles, splits, joins, and builds docs. It does not execute API tests or host mock servers. For headless test execution with JUnit and HTML reports, use apidog run.

Is Apidog open source like Redocly CLI?

No. Redocly CLI and Spectral are open source. Apidog is freemium. The CLI is installable from npm, but it operates against an Apidog account and project.

I used swagger-cli for validate and bundle. What should I move to?

Use Redocly CLI if you want the closest code-first replacement:

redocly lint openapi.yaml
redocly bundle openapi.yaml --output bundled.json
Enter fullscreen mode Exit fullscreen mode

Use Apidog CLI if you also want project import/export, testing, mocks, and docs:

apidog import --project 123456 --format openapi --file ./openapi.yaml
apidog export --project 123456 --format openapi --output ./openapi.json
Enter fullscreen mode Exit fullscreen mode

Redocly CLI is the better standalone replacement for swagger-cli. Apidog CLI is the better option when validation and bundling are part of a broader API platform workflow.

Top comments (0)