Skip to Content
HeyBug docs
Concepts

Key terms

HeyBug has a small vocabulary.

HeyBug has a small vocabulary. A workspace owns projects; a project owns environments and saved tests; a run executes one or more tests and produces one result per test. This guide defines each term and shows where it appears in the app, the API and the CLI.

Use it when an id in a command, a response or a URL is not obvious. Each section links to the guide that goes deeper.

Workspace

A workspace is the boundary for everything you do in HeyBug. It owns projects, API keys, members, billing and usage. A person can belong to more than one workspace, but a project in one workspace never appears in another.

The breadcrumb at the top of every signed-in page names the active workspace. heybug auth status shows the workspace and the permissions of the key you are using. If you work in several workspaces, save a separate CLI profile for each key:

printf '%s' "$CHECKOUT_KEY" | heybug auth login --token-stdin --profile checkout
HEYBUG_PROFILE=checkout heybug auth status

See Workspaces and API keys.

Project

A project is the unit of testing. It holds the frontend or backend tests for one app and the environments those tests run against. Every project has a projectId and a base URL. A project can be active, a draft or archived.

heybug project create --name Checkout --url https://staging.example.com

The reply includes the project id. Pass it to commands with --project, or set HEYBUG_PROJECT_ID.

See Projects and Getting started.

Environment

An environment names a deployment and stores its URL and sign-in settings. The first environment you add becomes the Default environment. A run uses the project's default environment unless you choose another one with --env or in the run options.

heybug env create --project "$PROJECT_ID" --name staging --url https://staging.example.com

Secrets are write-only: the API returns set: true, never the value. The agent explores and runs against the default environment unless your request names another.

See Project settings and the run options in Runs.

Test

A test is a saved case with a title, a stable key such as TC-001, a priority and plain-English steps. HeyBug's agent proposes changes to a test; you review the proposal and apply it to save a new plan version. The case key stays the same across edits, so results and cached scripts follow the case.

The case key under caseKey in heybug tests list and heybug tests get is the test id you pass to a run.

heybug tests list --project "$PROJECT_ID"
heybug tests get TC-001 --project "$PROJECT_ID"

See Creating tests and Editing steps.

Run and run id

One run is one execution. It can contain one test or the whole suite. The runId identifies that execution from start to finish, including while it is queued or running.

Each test in the run gets its own result id (resultId) for reading its verdict and evidence. Running the same saved test again keeps its test id and creates a new result.

IdWhat it identifiesWhere to use it
Test idA saved case, such as TC-001heybug runs start --project <id> TC-001, heybug tests get TC-001
runIdOne executionheybug runs wait <runId>, heybug runs cancel <runId>, heybug results list --run <runId>
resultIdOne case's outcome in an executionheybug results get <resultId>

A run receipt contains the execution under runs[] and the individual outcomes under results[]. To find a case's latest result in staging, list its results and take the first:

heybug results list --case TC-001 --project "$PROJECT_ID" --status failed,error

See Running tests and Reading results.

Status

heybug results list --run reports the execution's progress in run.status. A finished execution can mix passing and failing results. The web shows a result as Queued, Writing test, Running, Passed, Failed, Blocked, Error, Skipped or Canceled. A blocked case is stored with the status error, so the --status filter uses error for it.

  • A run is Passed only when every case passed.
  • A run is Failed when any case failed.
  • Blocked means the environment stopped the case (an unreachable site, a login that did not work). It is not an app bug.
  • Canceled means someone stopped the run before the case finished.

The --status filter matches stored statuses: passed, failed, error and skipped.

A saved test definition is available independently of any result, so you can read the steps of a case that has never run.

See Status meanings for the full table and the Failed versus Blocked rule.

Result evidence

heybug results get reads the outcome for one result id. For browser failures it includes the failed step, page snapshots, step screenshots and, when available, video. Backend results include the captured API output and a traceback. The result can also include a cause and a suggested fix.

Download the available files into a directory:

heybug results get <resultId> --out ./evidence

That writes result.json, the step screenshots under steps/, and the spec file as <caseKey>.spec.ts. Use --failed-only --run <runId> --out <dir> to save every failed case of a run.

See Reading results and CLI results.

Credits

Executions use the workspace's credits. heybug usage (alias heybug credits) shows the plan, the billing period and usage against the plan limits. An insufficient balance returns exit code 12; a feature that is not on the plan returns exit code 13.

heybug usage
heybug credits --json

API key and scopes

An API key grants the CLI, CI or an MCP client access to one workspace. The key is shown once when you create it; lists show only the ot_ prefix. Send it as Authorization: Bearer ot_....

Scopes control individual operations:

ScopeWhat it allows
read:meRead the signed-in user, workspace and role.
read:projects, write:projectsRead or change projects and environments.
read:tests, write:testsRead or change plans, cases and explorations.
run:testsStart, wait for and cancel runs.
read:schedules, write:schedulesRead or change schedules.
read:billingRead usage and plan information.

A key with no scopes has full access. Check the active scopes and expiry with:

heybug auth status
heybug auth status --output json

The text output names the key, its scopes (or "full access") and its expiry. The JSON output includes a key object with id, name, prefix, scopes and expiresAt. An agent can read the same information with the heybug_check_account MCP tool.

See API keys and the scoped key controls on the API keys page.

Testing lifecycle concepts

The words below describe the loop the agent runs against a project. Each one is also a card on the Key terms page of a project (/p/{project}/key-terms), where the button runs the real action and the scope you save is used for the next exploration.

Generate and regenerate

Generate creates tests for the first time from your requirements and your project. Use it for a new project, to add tests to a project that has none, or to create initial coverage. A good prompt is Help me test this project with HeyBug. The agent explores the target app, writes a test plan, generates test code and runs it.

Regenerate recreates a test from scratch after a significant change. Use it when a flow was rebuilt, when the plan no longer matches the requirements, or when you want fresh coverage. A good prompt is Regenerate tests for the updated checkout flow. The agent re-analyses the change, updates the plan, writes new code, keeps the case key and runs the new test.

Run and rerun

Run executes generated tests for the first time. Use it after generating tests or for the first validation of your app. It executes the saved tests, collects results and evidence, and writes a report.

Rerun executes existing tests again without regenerating them. Use it to validate a fix you just applied, to confirm a pass after a restart, or for a quick smoke check. A good prompt is Rerun the login and checkout tests with HeyBug. It uses the existing tests, runs them against the current app state and reports new results under a new run id.

Healing

Healing is an automatic or suggested fix for a brittle test that fails because of a non-functional change, not a real bug. It handles changed selectors, timing on slow components, changed fixtures, environment details such as ports and credentials, and schemas that need tighter assertions. When a failure looks like fragility, the agent proposes a fix and verifies it. Low-risk fixes apply automatically; larger changes ask for approval.

What healing isWhat healing is not
Making tests resilient to non-functional code changesMasking real product bugs
Reducing test maintenance busyworkMaking tests pass when they should fail

Test scope

Test scope chooses what the agent analyses and tests. Codebase covers the entire project and gives full coverage, at the cost of a longer run. Code diff covers only the files that changed (uncommitted git changes), which is faster and suits feature branches. The selector on a project's Key terms page saves the choice; code diff needs at least one changed file. An agent can set the same scope with heybug_key_terms or heybug explore --changed.

PRD and normalized PRD

A PRD is your original description of the product: notes, a README, a specification, a ticket or a design doc all work. HeyBug converts it to a normalized PRD, a structured document with a product overview and goals, core features with acceptance criteria, user flows and validation rules, and technical context from code analysis. The normalized view drives plan generation, so the style of your original document does not change the result. Upload documents on the project's Sources page (/p/{project}/sources).

Test plan

A test plan is the structured list of cases the agent will run. Each case has a stable id such as TC-001, plain-English steps, a category such as functional or security, a priority and an expected outcome. Plans are saved as versions, so you can review the change before you apply it, and you can download the current plan as a JSON file. Review it on the project's plan page (/p/{project}/plan).

On this page