Skip to main content
Once a test exists, you can change its metadata, replace its plan or code, or remove it — all from the CLI.

Creating Tests

Author new tests from the CLI.

Editing a test

Metadata (name, description, priority) — use test update:
testsprite test update test_3a9f21c7 --name "Guest checkout v2" --priority p0
Frontend plan steps — use test plan put:
testsprite test plan put test_3a9f21c7 --steps ./updated-steps.json
The --steps file must contain a JSON object with a planSteps array (≤ 200 steps, ≤ 256 KB). Pass --expected-step-count <n> as an optional concurrency check — the server returns 412 if the current step count differs, preventing a silent overwrite. Backend test code — use test code put:
# Safe update: supply the codeVersion you read from the last create/update
testsprite test code put test_3a9f21c7 \
  --code-file ./tests/create_order_v2.py \
  --expected-version v3

# Force overwrite regardless of current version (audit-logged)
testsprite test code put test_3a9f21c7 \
  --code-file ./tests/create_order_v2.py \
  --force
--expected-version checks the codeVersion (e.g. v3) you received from the last create or update. If the test has a newer version, the CLI exits with a conflict (exit 6) — re-fetch the current code and retry. --force overwrites regardless of the current version. The two flags are mutually exclusive. codeVersion is an opaque version token that changes on every code change. It prevents two agents (or a human and an agent) from silently overwriting each other’s edits.

The Agent Loop

More on safe concurrent edits.

Deleting tests

Delete a single test — --confirm is required:
testsprite test delete test_3a9f21c7 --confirm
Delete multiple tests in one call:
# By explicit IDs
testsprite test delete-batch test_3a9f21c7 test_b1e04f2a --confirm

# All tests in a project
testsprite test delete-batch --all --project proj_8f0f6 --confirm

# All failed tests in a project
testsprite test delete-batch --all --project proj_8f0f6 --status failed --confirm
The CLI prints a summary line: Deleted N, Skipped M, Failed K. A 404 response counts as skipped rather than an error, so it is safe to pass IDs that may have already been deleted. Exit codes: 0 if all targeted tests were deleted or skipped; 1 if any deletion failed; 5 for validation errors.

Where to Go Next

Creating Tests

Author frontend plans and backend code, single or in batches

Running Tests

Trigger runs, poll for verdicts, and handle timeouts

Reading Results

Fetch failure bundles, steps, and run history

Command Reference

Full flag listing for every command