CLI reference

Report formats and viewer

HTML, JSON, Markdown and stdout reports, and how to open them in the Lighthouse viewer.

Every run produces one report per flow in each configured format. Choose formats in the rc file under persist.format or per run with --format.

# one format
npx user-flow collect --format html

# several formats at once
npx user-flow collect --format html --format json
.user-flowrc.json
{
  "persist": {
    "outPath": "./measures",
    "format": ["html", "json"]
  }
}

The four formats#

FormatFileBest for
html<flow-name>.uf.htmlReading a report in the browser. It is a single self-contained file with the full Lighthouse UI for every step.
json<flow-name>.uf.jsonProgrammatic processing, archiving and the Lighthouse viewer. Most other features of the CLI build on this format.
md<flow-name>.uf.mdPull request comments and chat messages. It summarises each step and its category scores in a table.
stdoutQuick checks in the terminal and CI logs. Same content as md, printed to the console.
HTMLJSONMarkdown
HTML reportJSON reportMarkdown report

Example files from the repository: order-coffee.json, order-coffee.html and order-coffee.md.

Opening reports#

By default the CLI opens the report as soon as the run finishes. HTML opens in the browser, JSON and Markdown in your text editor. Turn it off with --no-openReport or -e false; in CI mode it is off already.

The Lighthouse viewer#

A JSON report can be dragged and dropped into the Lighthouse viewer at any time. This is handy for reports that were produced in CI and stored as artefacts.

Lighthouse viewer file drop area

Reading a report#

Each step in a flow appears in the report with the icon of its measurement mode and the category scores that mode supports.

A user flow report with navigation, timespan and snapshot steps

See Basic user flows for what each mode measures and Understanding the Lighthouse result for the structure of the JSON.