The spectral-report command will generate a linting report that is the same as the Spectral JSON output. It’s a drop-in replacement for any application using Spectral, but wants to go much faster.

vacuum spectral report

This will generate a report from your my-openapi-spec.yaml and will save the file as spectral.json

If you leave the optional second argument off, then the default file output of vacuum-spectral-report.json will be used.

Available Flags

spectral-report supports the following flags

Short Full Input Description
-h –help bool Show help screen and all flag details
-i –stdin bool Use stdin instead of reading OpenAPI spec from a file
-o –stdout bool Use stdout instead of writing Spectral report to a file

Global Flags

spectral-report supports the following global flags

Short Full Input Description
-r –ruleset string Use an existing ruleset file for linting
-t –time bool Show how long vacuum took to run (ms)

Full flags begin with a double hyphen.

Examples

Use stdin and stdout

Here is an example of how to use stdin and stdout with the spectral-report command, and pipe the output to jq

vacuum spectral-report using stdin and stdout