Skip to main content

Two ways to use the CLI

Both start with the same one-minute install.
With your coding agent. Most users let their coding agent — Claude Code, Codex, Cursor, Cline, Windsurf, Copilot — drive the CLI: you describe what you want in plain language, and the agent creates tests, triggers real cloud runs, reads what broke, fixes the code, and reruns. From the terminal. Prefer typing commands yourself? Every command the agent runs is one you can run directly — switch to the terminal tab in Step 2.

Step 1: Install and run setup

Run it once from your repo root and paste your API key when prompted. You’re set when you see:

API Keys

Create one in the Portal under Settings → API Keys

Step 2: Run your first test

1. Install the skills for your agent

Every prompt below is powered by these skills, so take five seconds to install them for the agent you use.
The CLI ships two agent skills — the instruction manual your coding agent follows: when to run tests, how to read failure bundles, and how to loop until green. Run the command from the root of the repo you’re working on — that’s where your agent looks for them:

Coding Agent Integration

All supported agents and where each skill file lands

2. Say this to your agent

Open your coding agent in the repo and say:
That’s the whole prompt. The skills you just installed carry the mechanics — your agent will:
  1. Read your codebase to find the most important user flows (instead of blindly crawling).
  2. Ask you for your deployed app URL — and login credentials, if your flows need them.
  3. Create a TestSprite project and author a test suite (~8–15 tests with concrete assertions).
  4. Run the highest-value flows in the cloud, against your live app, with a real browser.
  5. Report back with pass/fail verdicts and dashboard links — and quote the credit cost before running anything more.
Have the URL and credentials ready; it’s the only thing the agent can’t figure out from your code.The CLI tests deployed http(s):// URLs and rejects localhost. If your app only runs locally, use the MCP Server instead — it owns the tunnel that exposes your local app to the cloud runner.

3. Make it part of your workflow

This is where the CLI earns its keep: the testsprite-verify skill triggers every time your agent finishes a change — it finds or creates the covering test, runs it to a verdict, and won’t report “done” on an unverified change. Make it a standing instruction:
And when a run fails, hand the agent the loop:
The agent reads the failure bundle (failing step, DOM snapshots, root-cause hypothesis), fixes the code, and reruns. Every confirmed pass is banked into your durable suite, so the next change reruns rather than recreates — coverage compounds.

4. Keep the agent on track

  • Pin the project. Commit .testsprite/config.json with { "projectId": "proj_8f0f6" } at the repo root so the agent never guesses which project to run against.
  • Costs stay your call. The agent smoke-runs a few tests, never the full suite — full-suite runs are always your explicit choice, with the credit cost quoted up front.
  • Honesty is by design. If the agent can’t run a test (no credentials, no reachable URL), it says “shipped but unverified because X” rather than pretending.

Coding Agent Integration

What the installed skills do in detail, all eight agent targets, and skill health checks

Where to Go Next

Coding Agent Integration

All eight agent targets, install flags, skill health checks, and what the skills teach your agent

The Agent Loop

Why the loop is designed this way — self-consistent bundles and compounding coverage

Creating Tests

Plan files, code files, batch create, and dependency authoring

Command Reference

Every command, flag, and exit code in one place