Zuplo CLI

Zuplo CLI: Lint

Applies to
Gatewayruntime for API, AI, and MCP gateways
Hosting
Managed EdgeManaged DedicatedSelf-Hosted
Lints your OpenAPI specs and policies for errors and Zuplo conventions
Code
zuplo lint [options]

zuplo lint checks the OpenAPI files in your project's config/ directory and config/policies.json for missing fields, undefined policies, invalid policy options, and Zuplo conventions. It runs locally and doesn't need an API key. See Linting your API for an overview of what it checks.

The command reads its settings from zuplo.lint.jsonc (or zuplo.lint.json) in the project directory. See Lint configuration for presets, rule severities, required policies, and breaking change detection.

Exit codes

CodeMeaning
0No results at or above the failure threshold.
1The linter found results at or above the failure threshold.
2The linter couldn't run: the directory isn't a Zuplo project, or the configuration file is invalid.

Common use cases

Lint before you commit

TerminalCode
npx zuplo lint

Apply automatic fixes

--fix adds missing operationId values and removes empty inbound policy arrays, then reports what's left. See Fix problems automatically.

TerminalCode
npx zuplo lint --fix

List the rules you can use

TerminalCode
npx zuplo lint --list-rules

Add --format json for machine-readable output.

Lint in CI

TerminalCode
npx zuplo lint --format sarif > zuplo-lint.sarif

See Lint in CI/CD for GitHub Actions workflows, including code scanning, and Breaking change detection for comparing your API against a Git branch.

Examples

Lint the project in the current directory

Code
zuplo lint

Apply the fixes that can be made automatically

Code
zuplo lint --fix

Fail the command on warnings as well as errors

Code
zuplo lint --fail-on warn

Emit SARIF for GitHub Code Scanning

Code
zuplo lint --format sarif > results.sarif

List the rules you can configure

Code
zuplo lint --list-rules

Options

--dir

The directory containing your Zuplo API

Type: stringDefault: "."

--config

Path to a lint config file. Defaults to zuplo.lint.jsonc or zuplo.lint.json in the project directory.

Type: string

--format

Output format

Type: stringDefault: "text"Choices: text, json, sarif

--fail-on

Severity threshold that fails the command. Defaults to the failOn value in your lint config, or 'error'.

Type: stringChoices: error, warn, none

--fix

Rewrite your OpenAPI files to fix what can be fixed automatically, then report what is left

Type: booleanDefault: false

--list-rules

List every rule a config can use, with its default severity and the rulesets that include it. Use --format json for machine-readable output.

Type: booleanDefault: false

Global options

The following global options are available for all commands:

Additional resources

Last modified on