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 have | What to read |
|---|---|
| A run ID | heybug results list --run <runId> --output json |
| A saved test key | heybug results list --case <caseKey> --project <projectId> --limit 1 --output json |
| A result ID | heybug 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 jsonCopy 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 jsonHistory is newest first. --limit defaults to 20 and accepts 1-100. Include cancelled explicitly when you want cancelled results.
List filters
| Flag | What 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,errorThe 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_3Use 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 ./evidenceKeep 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
| Code | Meaning |
|---|---|
| 0 | The command worked. |
| 2 | Usage. A required flag is missing or two flags conflict. |
| 3 | Not signed in, or the token was rejected. |
| 4 | The run or case result was not found. |
| 5 | The input is not valid. |
| 6 | The server could not be reached or failed. |
When it fails
- Usage message and exit 2. You passed
--casewithout--project, combined--runwith--case, or left out the case result id forget. Use one of the forms above. - Exit 3. Run
heybug auth status. If it shows no user, sign in again withheybug auth login. In CI, check thatHEYBUG_TOKENis set. - Exit 4. Check the id. Get run ids from
heybug runs list, and case result ids fromheybug results list. - Exit 6. Check the address in
HEYBUG_SERVER, then runheybug 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.