testsprite command. If a term in the docs feels unfamiliar, this is the place to land.
Project
A project is the top-level named container for your tests. Frontend projects target a live public URL; backend projects point at a codebase. Every project has a stableprojectId you use in most commands.
- What a project is
- How the CLI uses it
A project has:
- Type:
frontendorbackend - Target: a public
https://URL (frontend) or a codebase (backend) - Tests: every test case you have created inside it
- Run history: every execution of those tests, across all surfaces
Test
A test lives inside a project and is the unit the CLI runs, reruns, and reads results from. Every test has a type, a status, and a run history.- What a test is
- How the CLI uses it
A test has:
- Type:
frontend(an ordered plan of browser steps) orbackend(executable test code, typically Python) - Status: one of the nine normalized values in the Status table below
- Run history: every time the test was executed, across CLI, Portal, MCP, and scheduled runs
- Test ID: a stable
testIdused withtest get,test run,test failure get, and more
planSteps[]). Backend tests carry executable code (typically Python) with optional variable dependencies (--produces / --needs).Run and Run ID
A run is one execution of a test, from trigger to terminal verdict. Every run is identified by a stablerunId minted by the backend before the cloud test engine starts.
- What a run is
- How the CLI uses it
A run captures:
- Verdict: one of
passed,failed,blocked, orcancelled - Steps: a log of every step executed during that run
- Artifacts: DOM snapshots (rendered as text), root-cause hypothesis, recommended fix target — all tied to a single
snapshotId - Source: which surface triggered it —
cli,portal,mcp,schedule, orgithub_action
Status
Status is the normalized state of a test or a run. The CLI displays it in text mode and includes it in--output json responses. Use status values to filter lists and drive CI branching logic.
Test status (9 values)
| Value | Meaning | Terminal? |
|---|---|---|
| draft | Test exists but has no executable code yet | No |
| ready | Has code or a plan, never been run | No |
| queued | Run accepted; cloud engine not yet started | No |
| running | Execution in flight (pre-exec, exec, or post-exec analysis) | No |
| passed | Latest completed run passed | Yes |
| failed | Latest completed run failed (including infrastructure crash) | Yes |
| blocked | Run rejected before a real verdict was reached | Yes |
| cancelled | Run was cancelled before a verdict | Yes |
| unknown | Status cannot be derived | — |
Terminal statuses are the states the CLI considers “done” when polling with
--wait. Exit 0 means passed; exit 1 means failed, blocked, or cancelled.Run status (6 values)
Run-level status is a subset: queued, running, passed, failed, blocked, cancelled. Terminal run statuses are the same four: passed, failed, blocked, cancelled. Filter a test’s run history by status or other dimensions:Run Source
Every run is tagged with the surface that triggered it. The run source lets you filter history and understand where a pass or failure came from.- What run source is
- How the CLI uses it
The five source values are:
All CLI-triggered runs — including reruns — carry
| Source | When it appears |
|---|---|
| cli | Any testsprite test run or testsprite test rerun invocation |
| portal | A manual run from the Web Portal dashboard |
| mcp | A run triggered by the MCP Server plugin in your IDE |
| schedule | A scheduled run configured in the Portal |
| github_action | A run triggered from a GitHub Actions workflow |
source: "cli".Credits
Credits are the consumption unit for test execution. The CLI reports your balance viatestsprite usage and exits non-zero when balance is insufficient.
- What credits are
- How the CLI uses it
Key rules:
- A fresh
testsprite test runcharges credits. - A
testsprite test rerunverbatim replay does not charge credits. - Auto-heal is on by default and uses a small amount of credit only when it actually repairs a step — see Rerun & Auto-Heal.
- Backend test runs are free.
- Insufficient balance → the CLI exits with a non-zero code. See Exit Codes for the exact value and what to do.
Scopes
Scopes are permissions that an API key carries. The CLI checks scopes before sending write or run requests, and when access is denied it prints which scope was required and which scopes your key holds. Read commands need read scopes, writes needwrite:tests, and runs need run:tests; purely local commands like init and agent install need none.
See Authentication → Scopes for the full table of which scope gates which command.
Failure Bundle
A failure bundle is one self-consistent, run-scoped package of everything needed to understand and fix a test failure — assembled by the backend and downloaded by the CLI in a single command.- What a failure bundle is
- How the CLI uses it
A bundle contains:
- The failing step and its immediate neighbors (±1 step)
- DOM snapshots at the point of failure — HTML text your coding agent can read without a vision model, each with a short text description of what the step shows
- The test source (plan or code) at run time
- A root-cause hypothesis — the backend’s best guess at what broke
- A recommended fix target — which part of the code to look at
snapshotId, so the agent is always reasoning over a single consistent moment in the run. The CLI refuses to stitch data from two different runs.Where to Go Next
The Agent Loop
The verification loop, idempotency, and where the CLI fits in the bigger picture
Quickstart
Create your first test, run it, and read the result end to end
Reading Results
Statuses, failure bundles, run history, and artifact downloads
Command Reference
Every command, flag, and example in one place