CLI, CSV

The Stylish reporter is the default Spectral reporter. It can output a few different "styles" of reports that we've grown accustomed to: CLI, HTML, CSV, JSON.

If you want cool CLI-based reports with colors and to-the-point messaging, you don't need to do anything special to configure it, it's enabled by default with an empty stylish block:

.spectral/spectral.yaml
reporter:
outputs:
stylish: {} # produce CLI based reports

There are a few additional kinds of reports in this reporter below.

info

Note that we are sunsetting some of these reporters, as the new Spectral account UI cover them in a better way. The CLI and CSV outputs will always exist.

HTML

To configure Spectral to output HTML reports for infosec reviews, secops reviews or your periodical security email sendouts:

.spectral/spectral.yaml
reporter:
outputs:
stylish: { html: "output.html" } # produce HTML reports

CSV

If you want results in CSV format, to be sliced and diced later, or you have your own report generation pipeline that you only need to feed some CSV into, here's how to configure the stylish reporter to output CSV:

.spectral/spectral.yaml
reporter:
outputs:
stylish: { csv: "output.csv" } # produce CSV reports

JSON

If you want results in JSON format:

.spectral/spectral.yaml
reporter:
outputs:
stylish: { json: "output.json" } # produce JSON reports