Skip to main content

Prerequisites

Before installing, make sure you have:
  • Node.js >= 20 (Node 22 recommended)
  • A TestSprite accountSign up for free
  • A TestSprite API key (you’ll create one in the next section)
Run the following in your terminal:
node --version
If the output is below v20.0.0, download a newer release from nodejs.org . Node 22 is the recommended version.
Sign in to your TestSprite dashboard, navigate to Settings → API Keys, and click Create new key. The key is shown exactly once — copy it before closing the dialog. If you lose it, just create a new one.See API Keys for the full walkthrough.

Install

Install the CLI globally with npm:
npm install -g @testsprite/testsprite-cli
Alternatively, run it without installing using npx:
npx @testsprite/testsprite-cli --version
Verify the installation:
testsprite --version
0.1.x
The CLI’s source code, releases, and issue tracker live on GitHub.

Get Your API Key

  1. Sign in to your TestSprite dashboard .
  2. Navigate to Settings → API Keys and click Create new key.
API Keys page with the Create new key button
  1. Copy the key — it is shown once only. If you lose it, delete the key and create a new one.
API Key Created dialog with the copy button
New and grandfathered keys both default to the scopes the CLI needs: read:me, read:projects, read:tests, write:tests, and run:tests.

Sign In

Use testsprite init — it configures credentials, verifies them, and installs the agent skill in one pass. auth configure is for cases where you want fine-grained profile control or are scripting a headless setup.

Verify

After signing in, confirm the active profile:
testsprite auth whoami
userId    u_01abc...
name      Alice Example
email     alice@example.com
keyId     key_01xyz...
endpoint  https://api.testsprite.com
env       production
scopes    read:me read:projects read:tests write:tests run:tests
If any scopes are missing, the CLI prints a note: line telling you which commands will be blocked.

Using It in CI

In a CI environment, set TESTSPRITE_API_KEY as a secret and use the non-interactive init flag:
TESTSPRITE_API_KEY=$TS_KEY testsprite init --from-env --yes
--from-env reads the key from the environment instead of prompting. --yes accepts all defaults without interactive prompts. The CLI never accepts the API key as a positional argument or writes it to logs.

CI/CD Integration

The full CI setup — pipeline examples and exit code handling

Where to Go Next

Quickstart

Create a test, run it, and read the failure bundle end to end

Authentication

Profiles, env vars, scope errors, and rotating keys

Key Terms

Projects, tests, runs, and the object model

CI/CD Integration

Pipeline examples and non-interactive setup