testsprite command. If a term in the docs feels unfamiliar, this is the place to land.
Workspace
Every user has a personal workspace, and can belong to one or more shared workspaces. Every project, test, and API key belongs to exactly one workspace — whichever one is active when it’s created.- What a workspace is
- How the CLI uses it
- A personal workspace is created automatically for you; work here draws on your personal balance.
- A shared workspace holds work that belongs to the workspace itself, visible to every member; work here draws on the workspace’s balance instead.
Workspaces
Personal vs. shared workspaces, members, and roles
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)
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: "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.
Which balance
testsprite usage reports depends on your active API key: a personal key reports your personal balance, a workspace key reports that workspace’s balance. See API Key below.- What credits are
- How the CLI uses it
Key rules:
- A fresh
testsprite test runcharges credits. - A
testsprite test rerunis billed the same as a fresh run. - Auto-heal is on by default. See Rerun & Auto-Heal.
- Backend test runs consume credits too, billed per your plan — the exact per-run cost isn’t exposed by the API, so check
testsprite usageor the pricing page before a large batch. - Insufficient balance → the CLI exits with a non-zero code. See Exit Codes for the exact value and what to do.
API Key
The credential the CLI stores in~/.testsprite/credentials and sends with every request. Two kinds exist — a personal key (sk-user-...), the original kind, bound to you; and a workspace key (sk-member-...), scoped to a specific shared workspace and the only kind mintable today — see Workspace above for how the two relate.
- What an API key is
- How the CLI uses it
Every key carries a list of scopes (see Scopes below) regardless of kind.
testsprite setup verifies whichever key you provide against GET /me before storing it.API Keys
Personal vs. workspace keys — creation, expiry, and revocation
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; the purely local agent install command needs none, and setup works with any valid key.
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
- For backend tests: the run’s captured stdout (
apiOutput) and Python traceback (trace)
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