Skip to Content
HeyBug docs
CLI

CLI

The `@@CLI@@` binary signs you in, connects your coding agent, and runs a quick test of a URL from a terminal or CI.

The heybug binary signs you in, connects your coding agent, and runs a quick test of a URL from a terminal or CI.

heybug run --url https://your.app

It explores the URL, runs the tests, and prints the results. The exit code tells you if everything passed.

Install

curl -fsSL https://opentest.nagara.cloud/install.sh | sh

Replace the address with your server. The script picks the release archive for your OS and CPU, checks it against SHA256SUMS, and installs heybug into ~/.local/bin. It needs no sudo. Set HEYBUG_INSTALL_DIR to install somewhere else. Make sure that folder is on your PATH.

Log in

heybug login --server https://opentest.nagara.cloud

The CLI prints a code like ABCD-EFGH and a link to /device on your server, and opens the browser when it can. Sign in, check the code, and approve. The CLI then saves an API token named "CLI on " to your credential profile. It never prints the token. The code expires after 10 minutes.

On a machine with no browser, use heybug auth login --token-stdin and pipe a token created in Settings > API tokens. heybug auth status shows who you are signed in as, plus the key name, scopes and expiry. heybug doctor checks credentials, server and runner.

Connect a coding agent

heybug connect claude
heybug connect cursor
heybug connect vscode

Each command points the agent at your server's remote MCP endpoint, /api/mcp, using the token from heybug login.

ClientWhat it does
claudePrints the claude mcp add --transport http heybug <server>/api/mcp command for Claude Code.
cursorMerges mcpServers.heybug into .cursor/mcp.json.
vscodeMerges the server into .vscode/mcp.json.

The token is not shown unless you add --print. Treat that output as a secret and keep it out of git. See the MCP guide for the tools your agent gets. heybug mcp-config <client> prints a local stdio config instead.

To install the skills your agent uses to verify changes, see agent skills. heybug agent install writes them, heybug agent status checks them, and heybug agent list shows the supported agents.

Commands

Run heybug help for the full list. Besides run, these exist:

CommandUse
setupSave a token, update .gitignore, install agent skills, print agent config.
project, envList, create and archive projects and environments.
tests, plan, import, exportRead test cases, edit the plan, move tests in and out.
runs, results, reportStart, wait for and cancel runs, and read their results.
api, lists, ciRun endpoint tests, group cases, and set up CI.
models, usage, creditsModel providers, local model check (models local), plan and usage. See local models.
ping, doctor, telemetry, completion, agentConnectivity, checks, consent, shell completion, agent skills.

Quick run

Installed, signed in and connected, one command tests an app end to end:

heybug run --url https://your.app

It finds or creates the project, explores the app, plans the tests and runs them. The flags below change what it does, and the exit code tells you if everything passed.

Setup

VariableMeaningDefault
HEYBUG_SERVERServer address. --server overrides it.http://localhost:8080
HEYBUG_TOKENAccess token. It is never printed.none
HEYBUG_PROFILECredential profile that login saved.default

Flags

FlagMeaning
--url <url>The app to test. Required.
--project <id>Use this project. Default: find one by the URL's origin, or create one.
--instructions <text>Extra guidance for the agent, such as "focus on checkout".
--jsonPrint the result as JSON on stdout.
--no-waitStart the run and return at once.
--server <url>Server address.

Output

Progress goes to stderr, one line per change:

Exploring https://your.app
Running 12 tests
7/12 passed, 1 failed

The final output on stdout is a table of cases. Each row has a status glyph, key and title. Failed cases also show the failing step and the Actual result. The last line is the web URL of the run.

JSON output

With --json, stdout is one QuickRunResponse object:

{
  "id": "run_...",
  "status": "done",
  "project": { "id": "...", "name": "...", "baseUrl": "https://your.app" },
  "exploration": { },
  "run": {
    "id": "run_...", "status": "failed", "targetUrl": "https://your.app",
    "total": 12, "passed": 11, "failed": 1, "errored": 0
  },
  "cases": [
    {
      "caseKey": "...", "title": "...", "status": "failed",
      "failedStepIndex": 3, "expected": "...", "actual": "...",
      "errorMessage": "...", "durationMs": 4210, "stepCount": 6
    }
  ],
  "url": "https://.../runs/..."
}

Fields:

  • id: an exploration id (exp_...). If a plan already existed and you gave no instructions, it is the run id (run_...).
  • status: exploring, running, done or failed.
  • project: the project used.
  • exploration: present unless the id is a run id.
  • run: the run, once it exists.
  • cases: the results, once the run has finished. failedStepIndex is -1 when no step failed. Case status is one of queued, generating, running, passed, failed, error, skipped.
  • url: web link to the run or exploration.

With --no-wait, status is exploring or running and cases is absent.

Exit codes

CodeMeaning
0All tests passed.
1A test failed, or the run had an error.
2Usage error: unknown flag or missing argument.
3Auth error: missing, invalid or forbidden token.
4Not found: no such project or run.
5Invalid input.
6Server or network error. Try again.
130Interrupted with Ctrl-C. The run keeps going on the server. The CLI prints its URL.

See docs/cli/exit-codes.md for the full list.

CI example

export HEYBUG_SERVER=https://heybug.example.com
export HEYBUG_TOKEN=...
heybug run --url https://staging.your.app --json > result.json

The step fails the job if any test fails.

On this page