testsprite-cli README

The project's README from github.com/TestSprite/testsprite-cli. As one markdown file: README.md.

TestSprite

The verification layer for the agentic coding era.

AI ships code in minutes — verifying it hasn't. testsprite opens your live app, uses it like a real user, and shows your coding agent exactly what broke — so it fixes its own work before a bug ever reaches you.

Proof, in public: verification beats model size. With this CLI in the loop, the cheapest model in the field shipped the most correct app on an open leaderboard — 89%, at half the cost of the priciest one. See the leaderboard →

npm version npm downloads Node 20.19+, 22.13+, or 24+ License Apache 2.0 CI

Website Docs Follow on X LinkedIn Join our Discord

⭐ Help us reach more developers and grow the TestSprite community. Star this repo!

▶ Watch the launch video — the three hard limits every coding agent hits, and the loop that breaks them (4 min).


What is it?

TestSprite is the AI testing platform 100,000+ teams use to test their software, frontend and backend — in the cloud, against the live product, not mocks. This repo is its official CLI.

It puts that platform in your coding agent's hands: the agent verifies every behavior it ships, and what broke comes back as one result — the failed step, its cause and a fix — it can act on, with no dashboard scraping. Humans drive the same surface from a terminal or CI.

⭐️ Star the Repository

testsprite-repo-star-fast

If you find testsprite useful, a GitHub Star ⭐️ would be greatly appreciated — it helps other builders (and their agents) find the project, and stars notify you about new releases.

Quickstart

You need Node.js 20.19+ on the 20.x line, 22.13+ on 22.x, or 24 or later. Using 0.16? Read its command reference.

From your app's repository, install the CLI and run setup. It prompts for your workspace API key and installs the skills for the coding agents it detects.

npm install -g @testsprite/testsprite-cli
testsprite --version
testsprite setup
testsprite auth status

Choose your project and target. Run testsprite project list to find an existing project. For a new frontend project, create it and add the URL where your app is running. Replace the URL below with yours and set PROJECT_ID to the ID printed by project create.

testsprite project create --type frontend --name "Checkout"
PROJECT_ID=your-project-id
testsprite project env create "$PROJECT_ID" --name staging --url https://staging.example.com

Get your first test. Ask the project's agent to propose coverage. If it asks a question in a text message, answer with testsprite reply "your answer". For a question card, submit all the numbered answers together with testsprite apply --answer 1=b --answer 2=a,c. Review the proposed steps in the terminal and apply the plan when they match what you want to verify. For a backend project, attach the API specification with --file ./openapi.yaml.

testsprite plan "Verify that a guest can place an order with a test card" --project "$PROJECT_ID" --steps
testsprite apply
testsprite test list --project "$PROJECT_ID"

Run and inspect. A project run waits for the suite when you pass --wait. Exit 0 means it passed. On exit 1, look for a failed or blocked row in results[] and copy its resultId to inspect the error and available evidence. If no row failed, check runFailures for an execution-level error such as cancellation. Without --output json, each run also prints a Dashboard: link that opens it in the Portal.

testsprite run --project "$PROJECT_ID" --wait --output json
RESULT_ID=your-result-id
testsprite result get "$RESULT_ID" --out ".testsprite/results/$RESULT_ID"

After deploying a fix, run the affected test again with testsprite run "$TEST_ID" --wait, using its ID from test list. To resume waiting for a run you already started, use its run ID with testsprite run wait "$RUN_ID". The scripting example shows how to extract both IDs and preserve the verdict in CI.

Testing an environment on your machine

Start your frontend app on port 3000 and save it as the project's environment. A run on that environment opens a tunnel from this machine and waits for the cloud runner.

testsprite project env create "$PROJECT_ID" --name local --url http://localhost:3000
testsprite run --project "$PROJECT_ID" --env local

The project's agent explores the app through the same kind of tunnel: ask it with testsprite plan, and when it asks for a tunnel, run testsprite tunnel start in another terminal and testsprite reply "The tunnel is running.". Review and apply the test plan, then run with --env local. An ordinary Ctrl-C detaches a public run. With a tunnel this command opened, Ctrl-C cancels unfinished work by default and closes the tunnel. Local frontend testing and tunnels

Commands

Task Command
Check credentials or install coding-agent skills auth status, setup, agent status
Manage a project and its targets project list, project create, project env
Propose tests, review them and save them plan, status, reply, reject, apply
Find the ID or steps of a saved test test list --project <id>, test get <test-id>
Launch a project, named tests or a saved list run --project <id>, run <test-id...>, run --testlist <list-id>
Follow or cancel an execution run wait <run-id...>, run cancel <run-id...>
Read results and download evidence result list --run <run-id>, result list --test <test-id>, result get <result-id>
Automate scheduled tests or a pull-request gate schedule, ci init github, ci run

For test lists, tunnel management, usage, diagnostics, profiles and exit codes, see the command reference. To migrate shell scripts or previously installed agent skills from 0.16, see Upgrading from 0.16.

Why a CLI for coding agents?

How it works

Every time your agent changes code, it asks one question: is this behavior already covered by the suite?

Every pass is banked into a durable suite, so coverage compounds as the project grows — a lasting record of every requirement it has ever gotten right, far bigger than any context window.

flowchart TD
    A["🤖 Your coding agent<br/>Claude Code · Codex · Antigravity · Kimi · Cursor · Trae …"]
    D{"behavior already<br/>covered by the suite?"}
    B["<b>testsprite plan → apply</b><br/>the project's agent writes a test<br/>for the new behavior"]
    R["<b>testsprite run --project &lt;project-id&gt; --wait</b><br/>run the existing tests"]
    C{{"☁️ TestSprite testing agent<br/>runs the test like a real user against<br/>real browsers & real APIs on Cloud"}}
    F["<b>testsprite result get</b><br/>one test's result in the run:<br/>failed step · screenshots · video ·<br/>cause · fix"]
    S[("📚 Durable integration suite<br/>grows with every pass")]

    A -->|"writes / changes code"| D
    D -->|"no — new behavior"| B
    D -->|"yes"| R
    B --> R
    R --> C
    C -->|"pass ✅"| S
    C -->|"fail ❌"| F
    F -->|"agent reads the result<br/>& fixes the code"| A
    S -.->|"defines what's covered"| D

The cloud is a black box on purpose: your agent describes intent and reads results. It never has to know how the test was driven — only what a real user experienced.

Proved in public

On CoderCup — an open leaderboard where frontier coding agents build the same app under the same rules, with TestSprite as the referee — the cheapest model in the field shipped the most correct app on the board: 89%, at half the cost of the priciest one.

That's the point of all of this: you no longer need the biggest, most expensive model to ship software you can trust — top-tier quality, without paying top-tier prices, within reach of every team.

Getting help

Contributing

Contributions are welcome — the CLI is plain TypeScript/Node (20.19+, 22.13+, or 24+), tested with Vitest, built with tsc. Getting a dev loop running takes a minute:

git clone https://github.com/TestSprite/testsprite-cli.git
cd testsprite-cli && npm install
npm run build       # tsc → dist/ ; try it: node dist/index.js --help
npm test            # unit suite — no network or credentials needed
npm run lint:fix    # ESLint
npm run typecheck   # tsc --noEmit

Pull requests target the main branch. The full guide — build from source, test tiers, CI checks, branches, project layout — is in CONTRIBUTING.md.

Support — if you need any help, we're responsive on Discord, and feel free to email us at [email protected] too.

License

Apache-2.0 © TestSprite

testsprite-cli (TestSprite/testsprite-cli)

Searching Database…

What is this?The official CLI of TestSprite, an AI testing platform 100,000+ teams use to test frontend and backend in the cloud against the live product, not mocks — and feed what broke back to your coding agent so it fixes its own work.
So is this a cloud service or a tool running on my machine?Both: a terminal CLI whose tests execute in the TestSprite cloud against your live app. The same surface is drivable by a coding agent, by a human in a terminal, or by CI.
How do I get it running?You need Node.js 20.19+, 22.13+, or 24+. Run 'testsprite setup' (or 'npx @testsprite/testsprite-cli' with no global install): one command asks for your API key, verifies it, and installs the verification-loop skill into your coding agents.
Which coding agents can it plug into?Eight targets: claude, cursor, cline, windsurf, antigravity, kiro, copilot, codex. Setup detects which ones you use and installs the skill for them; 'testsprite agent status' shows the result any time.
Any gotchas I should know about before relying on it?TLS is mandatory — the CLI never falls back to plaintext, so on networks that re-sign TLS you must point NODE_EXTRA_CA_CERTS at your organization's root CA. Free-plan portal runs also stay blocked until you set a public project URL.
Is it only useful if I code with an AI agent?No — the agent loop is the headline flow, but humans can drive the same CLI surface from a terminal or CI, with non-interactive flags for CI and onboarding scripts.
What leaves my machine when I use it?Test traffic runs through TestSprite's TLS-encrypted cloud tunnel. The only routine check-in is an npm registry lookup at most once per 24h that sends the package name only, never your key or data; an env variable disables it.
What does my agent get back when a test fails?One self-contained latest-failure bundle from 'testsprite test failure get' — verdict, per-step status with screenshot and DOM pointers — built so the agent can act on it directly. 'test failure summary' gives a one-screen triage card, and 'test diff' compares two runs, including per-step status flips.
Can TestSprite propose tests instead of me writing them?Yes. 'testsprite test plan generate --project' explores your app (or reads an uploaded API spec), drafts cases, and stages them for review without touching your disk — you keep what you want. Each stage that runs spends credits, and a PRD upload bills 0.5 credits for embedding while an API spec is free.
Do I have to author test plans online?No. 'test scaffold' emits a schema-correct starter plan and 'test lint' validates plan files fully offline — no network, no credentials — with --dry-run to preview commands. Local projects skip exploration entirely and run from authored plans via 'test create --plan-from'.
How do I check that everything is wired up correctly?'testsprite doctor' runs a full environment diagnostic — CLI and Node versions, profile, endpoint, credentials, connectivity, agent skill — and exits non-zero on failure. 'testsprite agent status' shows which of your coding agents have the verification skill installed.
Creator
TestSprite
Size
2.4 MB
Stars
5.2K
Age
5mo
Commits · 90 Days