Skip to main content
Every command follows the same pattern: global flags come first, then the subcommand and its own flags. Run any command with --help to see its flags inline.

Global flags

These flags must appear before the subcommand (e.g. testsprite --output json test run ...). They apply to every command.
FlagTypeDefaultDescription
--output <mode>json|texttextOutput format. json is the stable agent/CI contract. Invalid value → exit 5.
--profile <name>stringdefaultConfiguration profile to use from ~/.testsprite/credentials.
--verboseflagfalseHuman-readable retry/backoff/polling transitions to stderr. Less noisy than --debug.
--debugflagfalsePrint HTTP method/path, request ID, latency, and retry decisions to stderr.
--dry-runflagfalseSkip network, credentials, and filesystem; emit a canned sample matching the OpenAPI contract. Learn any command offline without an API key.
--request-timeout <seconds>number120Client-side per-request timeout (1–600 s). Does not affect --wait polling. Env: TESTSPRITE_REQUEST_TIMEOUT_MS (ms).
-V, --versionflagPrint version and exit 0.
-h, --helpflagPrint help and exit 0.

Command tree

testsprite
├── init                              One-shot onboarding (configure key + install agent skill)
├── auth
│   ├── configure                     Store an API key (validated against /me before writing)
│   ├── whoami  (alias: status)       Show user/key/scopes for active profile
│   └── logout                        Remove credentials for active profile
├── project
│   ├── list                          List projects
│   ├── get <project-id>              Get a project by id
│   ├── create                        Create a new project
│   └── update <project-id>           Update project metadata
├── test
│   ├── list                          List tests in a project (--project required)
│   ├── get <test-id>                 Get a test by id
│   ├── create                        Create a test (--code-file BE | --plan-from FE)
│   ├── create-batch                  Create multiple FE tests from plan specs
│   ├── update <test-id>              Update test metadata
│   ├── delete <test-id>              Permanently delete a test (--confirm required)
│   ├── delete-batch [test-ids...]    Bulk delete (--confirm required)
│   ├── steps <test-id>               List steps (cumulative; --run-id to scope)
│   ├── result <test-id>              Latest result (or --history for run list)
│   ├── run [test-id]                 Trigger a run (or --all for BE batch)
│   ├── wait <run-id>                 Wait for a run to reach terminal status
│   ├── rerun [test-ids...]           Re-execute as replay (FE no-credit; BE closure)
│   ├── code get <test-id>            Print generated test code
│   ├── code put <test-id>            Replace test code (etag/codeVersion guarded)
│   ├── plan put <test-id>            Replace an FE test's planSteps[]
│   ├── failure get <test-id>         Write failure bundle for latest failing run
│   ├── failure summary <test-id>     One-screen triage card
│   └── artifact get <run-id>         Download failure bundle for a SPECIFIC run
├── agent
│   ├── install                       Write the TestSprite skill file into a project
│   └── list                          List supported agent targets
└── usage  (alias: credits)           Show credit balance & plan info

Commands

Chains auth configureauth whoamiagent install and prints a unified summary. Installs credentials and the coding-agent skill in one step.
testsprite init [options]
FlagDescription
--api-key <key>API key to configure (skips the interactive prompt)
--from-envRead TESTSPRITE_API_KEY from the environment instead of prompting
--agent <target>Coding-agent target: claude, cursor, cline, antigravity, codex (default claude)
--no-agentSkip the agent skill install — configure credentials only
--forceOverwrite an existing skill file (a .bak backup is kept)
--dir <path>Project root for the skill install (default: cwd)
-y, --yesNon-interactive: accept all defaults, never prompt
No TTY + no --api-key + no --from-env → exit 5. Use --from-env in CI.
Text output: TestSprite initialized. followed by profile, endpoint, scopes, agent result, and next steps.
Manage API keys and profiles.auth configure — store an API key for the active profile. Validates against GET /me before writing; never overwrites a working profile with a rejected key.
testsprite auth configure [--from-env]
FlagDescription
--from-envRead TESTSPRITE_API_KEY from the environment
Text output: Profile "<name>" configured. Endpoint: <url>
auth whoami (alias: auth status) — show the user, API key, and scopes for the active profile. No flags.
testsprite auth whoami
Text output lines: userId / name / email / keyId / endpoint / env / scopes. Prints a note: line if write or run scopes are missing.
auth logout — remove credentials for the active profile. No flags.
testsprite auth logout
Manage projects. A project is a named container with a target URL (frontend) or codebase (backend).project list
testsprite project list [options]
FlagDescription
--page-size <n>Items per page (1–100, default 25)
--starting-token <token>Opaque cursor from a previous list response
--max-items <n>Stop after this many items across auto-paged pages
Text columns: ID NAME TYPE FROM CREATED. Appends nextToken: <token> when a next page exists.
project get <project-id> — no flags. Text: id / name / type / createdFrom / createdAt / updatedAt.
testsprite project get <project-id>

project create
testsprite project create --type <frontend|backend> --name <name> [options]
FlagRequiredDescription
--type <frontend|backend>YesProject type
--name <name>YesDisplay name
--url <url>Yes (FE)Public http/https URL — no localhost or private IPs
--description <text>NoUp to 2000 characters
--username <user>NoOptional auth credential
--password <pw>NoOptional auth credential
--password-file <path>NoRead password from file (use this for non-interactive)
--instruction <text>NoOptional FE plan-gen instruction hint
--idempotency-key <token>NoPin for safe retries (defaults to a UUIDv4 per invocation)

project update <project-id> — flags: --name, --url, --username, --password, --password-file, --description, --instruction, --idempotency-key. At least one mutable flag required (else exit 5).
testsprite project update <project-id> --name "New Name"
Create a test from saved code (--code-file) or an agent-supplied plan (--plan-from, frontend only). Combine with --run --wait to create and block for a verdict in one command.
testsprite test create --project <id> --type <frontend|backend> --name <name> [options]
FlagRequiredDescription
--project <id>Yes (code-file path)Project to create the test in
--type <frontend|backend>Yes (code-file path)Test type
--name <name>Yes (code-file path)Title (≤ 200 characters)
--code-file <path>File with test code (≤ 350 KB). Mutually exclusive with --plan-from.
--plan-from <path>JSON with full FE test definition: projectId, type, name, planSteps[] (≤ 256 KB). In this mode --project/--type/--name/--description/--priority are ignored.
--description <text>NoUp to 2000 characters
--priority <p0|p1|p2|p3>NoTest priority
--runNoAfter create, trigger the test
--waitNoWith --run: poll until terminal
--timeout <s>NoWith --run --wait: max seconds (default 600)
--target-url <url>NoWith --run: override project default URL
--idempotency-key <token>No1–256 ASCII; pin for safe retries
--produces <var>No (BE only)Variable this test captures; repeatable. Drives wave ordering on run --all.
--needs <var>No (BE only)Variable this test consumes; repeatable
--category <str>No (BE only)Use teardown or cleanup to mark a final-wave cleanup test
Output (no --run): { testId, type, codeVersion, createdAt, dashboardUrl? }. With --run --wait, merges a run object.
--plan-from and --code-file are mutually exclusive. --produces, --needs, and --category only apply to backend tests using --code-file.
Create multiple frontend tests from a JSONL of plan specs or a directory of plan files.
testsprite test create-batch --plans <path> [options]
FlagRequiredDescription
--plans <path>Yes (XOR --plan-from-dir)JSONL file, one plan spec per line (≤ 50 specs, ≤ 5 MB)
--plan-from-dir <dir>Yes (XOR --plans)Directory of *.json plan files, sorted by filename (≤ 50 files, ≤ 5 MB total)
--runNoTrigger each test after creation
--waitNoWith --run: poll until all terminal
--timeout <s>NoDefault 600
--target-url <url>NoOverride project default URL
--max-concurrency <n>NoMax in-flight triggers (1–100, default 50). Server caps at 60/min/key; CLI throttles to 50/min.
--idempotency-key <token>NoBatch-level idempotency key
Update a test’s name, description, or priority.
testsprite test update <test-id> [options]
FlagDescription
--name <name>New title
--description <text>Up to 2000 characters
--priority <p0|p1|p2|p3>Test priority
--idempotency-key <token>For safe retries
test delete <test-id> — permanently delete one test. --confirm is required.
testsprite test delete <test-id> --confirm
FlagRequiredDescription
--confirmYesExplicit confirmation for the destructive operation
--idempotency-key <token>NoFor safe retries

test delete-batch — bulk delete by ID list, project, or status filter.
testsprite test delete-batch [test-ids...] --confirm [options]
FlagRequiredDescription
--confirmYesRequired for any destructive operation
--allNoDelete all tests in resolved project (requires --project)
--project <id>NoRequired with --all
--status <list>NoWith --all: only delete matching statuses (comma-separated)
Prints Deleted N, Skipped M, Failed K. A 404 counts as skipped, not an error. Exit 0 all deleted; 1 some failed; 5 validation.
test list — list tests in a project. --project is required.
testsprite test list --project <id> [options]
FlagDescription
--project <id>Required
--type <frontend|backend>Filter by type
--created-from <portal|mcp|cli>Filter by author surface
--status <list>Comma-separated: draft, ready, queued, running, passed, failed, blocked, cancelled, unknown
--page-size <n>Default 25
--starting-token <token>Pagination cursor
--max-items <n>Stop after this many total items

test get <test-id> — no flags. JSON: { id, projectId, projectName?, name, type, createdFrom, status, createdAt, updatedAt, planStepCount?, details?, priority? }.
testsprite test get <test-id>
List the cumulative step log for a test across every run. Use --run-id to scope to one run.
testsprite test steps <test-id> [options]
FlagDescription
--run-id <id>Scope steps to a specific run
--page-size <n>Default 25
--max-items <n>Stop after this many items
--starting-token <token>Pagination cursor
Show the latest result for a test, or list prior runs with --history.
testsprite test result <test-id> [options]
FlagDescription
--include-analysisAttach inline analysis block: rootCauseHypothesis, recommendedFixTarget, failureKind, snapshotId
--historyList prior runs instead of latest result
--source <cli|portal|mcp|schedule|github_action>With --history: filter by trigger source
--since <dur>With --history: lower bound on createdAt24h, 7d, or ISO timestamp
--page-size <n>Default 20 (1–100)
--cursor <token>Pagination cursor
Default JSON: CliLatestResult. With --history: { runs: RunHistoryItem[], nextCursor: string|null }.
Trigger a test run. Combine with --wait to block until terminal. Use --all --project <id> for a wave-ordered batch run of all backend tests.
testsprite test run [test-id] [options]
FlagRequiredDescription
--allNoRun all BE tests in project in wave order. Mutually exclusive with <test-id>.
--project <id>Yes (with --all)Project to run
--waitNoPoll until terminal or --timeout
--timeout <s>No1–3600, default 600
--target-url <url>NoOverride project default URL (no localhost or private IPs)
--idempotency-key <key>No1–256 characters
--filter <substr>NoWith --all: only tests whose name contains this string (case-insensitive)
--max-concurrency <n>NoWith --all --wait: max in-flight polls (1–100, default 50)
On failure, blocked, or cancelled: run testsprite test artifact get <run-id> to pull the failure bundle.
Wait for a run already in flight to reach a terminal status. Use this to resume after a --timeout on test run.
testsprite test wait <run-id> [options]
FlagDescription
--timeout <s>1–3600, default 600
Exit codes: 0 passed; 1 failed/blocked/cancelled; 3 auth; 4 run not found; 7 timeout; 10 transport.Text output: runId / status / targetUrl / codeVersion / startedAt / finishedAt / steps / dashboard.
Re-execute a test as a replay. Frontend replays the saved script (no credit charge). Backend re-runs the full dependency closure (producer + teardown tests).
testsprite test rerun [test-ids...] [options]
FlagDescription
--allRerun all tests in resolved project (requires --project)
--project <id>Required with --all
--skip-terminalWith --all: skip tests already in a terminal status
--status <list>With --all: only matching statuses
--filter <substr>With --all: name substring match (case-insensitive)
--waitPoll until terminal
--timeout <s>1–3600, default 600
--no-auto-healOpt out of AI heal-on-drift for this FE rerun (default: auto-heal ON)
--skip-dependenciesBE only: rerun only the named test without the producer/teardown closure
--max-concurrency <n>1–100, default 50
--idempotency-key <key>For safe retries
Auto-heal is on by default and uses a small amount of credit only when it actually repairs a step — see Rerun & Auto-Heal.
test code get <test-id> — print the generated test code to stdout, or write to a file.
testsprite test code get <test-id> [--out <path>]
FlagDescription
--out <path>Write to file instead of stdout
JSON: { testId, language, framework, code, codeVersion }. Large code files are fetched transparently — you always receive the full code.
test code put <test-id> — replace test code with ETag-guarded optimistic concurrency.
testsprite test code put <test-id> --code-file <path> [options]
FlagRequiredDescription
--code-file <path>YesReplacement code file (≤ 350 KB)
--expected-version <v>NoExpected current codeVersion (e.g. v3). Fails with a conflict (exit 6) if the test changed since you fetched it. Mutually exclusive with --force.
--forceNoOverwrite regardless of current version (audit-logged). Mutually exclusive with --expected-version.
--language <typescript|javascript|python>NoOverride stored language
--idempotency-key <token>NoFor safe retries
Replace a frontend test’s planSteps[]. Returns 400 for backend tests — use test code put instead.
testsprite test plan put <test-id> --steps <path> [options]
FlagRequiredDescription
--steps <path>YesJSON file: { planSteps: [...] } (≤ 200 steps, ≤ 256 KB)
--expected-step-count <n>NoOptional concurrency check — returns 412 if current step count differs
--idempotency-key <token>NoFor safe retries
test failure get <test-id> — write a self-contained failure-context bundle for the latest failing run.
testsprite test failure get <test-id> [--out <dir>] [--failed-only]
FlagDescription
--out <dir>Directory to write the bundle into (default: print wire envelope to stdout)
--failed-onlyKeep only the failed step plus its immediate neighbors (±1)
The bundle contains: failing step + neighbors, DOM snapshots rendered as text for agents, the test source, a root-cause hypothesis, a recommended fix target — all sharing one snapshotId.
test failure summary <test-id> — print a one-screen triage card. No flags.
testsprite test failure summary <test-id>
JSON: { testId, status, failureKind, snapshotId, rootCauseHypothesis, recommendedFixTarget }.
Download the failure-context bundle for a specific run by runId. Unlike test failure get, this is immutable — a concurrent Portal or scheduled run cannot overwrite it.
testsprite test artifact get <run-id> [options]
FlagDescription
--out <dir>Output directory (default: ./.testsprite/runs/<run-id>/; parent must exist)
--failed-onlyKeep only the failed step plus its immediate neighbors (±1)
Exit codes: 0 written; 3 auth; 4 not found/not ready/no failure; 5 validation; 6 conflict (snapshot in flight, retried once); 10 transport (.partial left on disk).
agent install — write the TestSprite verification-loop skill file into a project for a coding agent. Pure local — no network, no credentials.
testsprite agent install [options]
FlagDescription
--target <t>Agent target (repeatable/comma-separated; prompts if TTY): claude, cursor, cline, antigravity, codex
--dir <path>Project root (default: cwd)
--forceOverwrite existing (a .bak backup is kept); for codex, replaces only the managed section
Supported targets:
TargetStatusModeLanding path
claudeGAown-file.claude/skills/testsprite-verify/SKILL.md
antigravityexperimentalown-file.agents/skills/testsprite-verify/SKILL.md
cursorexperimentalown-file.cursor/rules/testsprite-verify.mdc
clineexperimentalown-file.clinerules/testsprite-verify.md
codexexperimentalmanaged-sectionAGENTS.md
Exit 6 if any target is blocked (exists and differs, no --force).
agent list — list supported agent targets, their status, and landing paths. Pure local, no flags. Text columns: TARGET STATUS MODE PATH.
testsprite agent list
Show your account and plan info. Credit fields (credits, subPlan, creditsPerRun) appear when the backend supplies them.
testsprite usage
Alias: testsprite credits. Calls GET /me.

Where to Go Next

Configuration

Credentials file, profiles, environment variables, and the JSON output contract

Exit Codes & Errors

Every exit code, error code, and status value in one table

Creating Tests

How to author frontend and backend tests from the CLI

Running Tests

Triggering runs, polling, and pulling failure bundles