Skip to Content
HeyBug docs
CLI

Reading results from the CLI

`@@CLI@@ results` (or `@@CLI@@ result`) reads case results from your terminal.

heybug results (or heybug result) reads case results from your terminal. Use list to find outcomes for a run or a saved test, and get to inspect one result and download its evidence.

For the same data in the browser, see Reading results.

Find the result you need

What you haveWhat to read
A run IDheybug results list --run <runId> --output json
A saved test keyheybug results list --case <caseKey> --project <projectId> --limit 1 --output json
A result IDheybug results get <caseResultId> --output json

result get shows what happened on one attempt: status, failing step, expected, actual, error, steps, script, and evidence ids.

Pin to a specific run

In CI, use the run ID from the launch you are investigating:

heybug results list --run "$RUN_ID" --status failed,blocked --output json

Copy a resultId/id from results[] and inspect it:

heybug results get "$RESULT_ID" --output json

--status accepts passed,failed,error,running,blocked,cancelled,skipped,queued,generating. --env <name or id> limits list results to runs launched on that environment.

History by test case

heybug results list --case TC-001 --project <projectId> --env staging --limit 10 --output json

History is newest first. --limit defaults to 20 and accepts 1-100. Include cancelled explicitly when you want cancelled results.

List filters

FlagWhat it does
--run <runId>Lists every case result of one run.
--case <caseKey> --project <projectId>Lists the results of one case key across the recent runs of a project.
--status <list>Keeps only the statuses you name. Separate them with commas. Use lower case: passed, failed, error, skipped.

Use --run on its own, or --case with --project. Do not combine --run with --case.

heybug results list --run r_9 --status failed,error

The output is always JSON, with one entry per case result:

{
  "results": [
    {
      "id": "cr_3",
      "runId": "r_9",
      "caseKey": "checkout-1",
      "title": "Apply a coupon",
      "status": "failed",
      "expected": "The total drops by the coupon value.",
      "actual": "The total did not change."
    }
  ]
}

Get one result

heybug results get <caseResultId> --output json returns status, expected, actual, error, failed step, steps, script, and video/screenshot ids. Use --json for MCP-compatible fields (caseResult, steps, failedStepIndex, pageUrl, screenshots).

Download the evidence

heybug results get cr_3 --out ./evidence/cr_3

Use one directory per result. The command creates it and writes result.json, <caseKey>.spec.ts, step screenshots as steps/NNN.png, step HTML as steps/NNN.html, and video.mp4 when present. --failed-only downloads failed/error cases for a run:

heybug results get --failed-only --run r_9 --out ./evidence

Keep downloaded evidence private when it includes application data.

Use it from an agent

Use MCP tools heybug_list_results, heybug_get_result, heybug_get_run, and heybug_get_case_result. They return the same case/result identifiers and evidence fields so an agent can go from run to failing case to artifact without opening the browser.

Exit codes

CodeMeaning
0The command worked.
2Usage. A required flag is missing or two flags conflict.
3Not signed in, or the token was rejected.
4The run or case result was not found.
5The input is not valid.
6The server could not be reached or failed.

When it fails

  • Usage message and exit 2. You passed --case without --project, combined --run with --case, or left out the case result id for get. Use one of the forms above.
  • Exit 3. Run heybug auth status. If it shows no user, sign in again with heybug auth login. In CI, check that HEYBUG_TOKEN is set.
  • Exit 4. Check the id. Get run ids from heybug runs list, and case result ids from heybug results list.
  • Exit 6. Check the address in HEYBUG_SERVER, then run heybug doctor. It reports the server, credentials and runner.
  • "results": []. No case matched. Check the spelling of --status, which must be lower case with no spaces, or pick a different run.

On this page