TestNeo CLI
Run natural-language .testneo tests from your terminal or CI — same NLP format as the VS Code extension, same TestNeo execution backend and dashboard.
One line: Sign up free → create project & API key → npm i -g @testneo/cli → testneo run your.testneo --wait
npm install -g @testneo/cli
testneo config set apiKey tn_your_key
testneo config set projectId 47
testneo run login.testneo --wait --fail-on-error
Get started free (14-day trial) · @testneo/cli on npm
Also from TestNeo — pick your surface
| Package / surface | Use when |
|---|---|
@testneo/cli (this doc) | Terminal & CI — run .testneo files, smoke folders, testneo doctor |
| @testneo/playwright-ai-sdk | Playwright in Git + CI — ai.run + page / expect in TypeScript specs |
| @testneo/mcp-server | Cursor / Claude — generate, triage, batch from chat |
| TestNeo app | Projects, environments, live runs, team visibility |
Getting started (recommended path)
CLI runs tests on your TestNeo account (cloud or self-hosted API). Complete these steps once.
1) Sign up (14-day trial)
- app.testneo.ai/signup — create an account.
- Use the 14-day trial to explore the product.
- Sign in at app.testneo.ai.
2) Create a web project
- Projects → Create project (e.g.
My Web Tests, URLhttps://www.saucedemo.com). - Note project ID (e.g.
47).
3) Add an environment
- Project → Environments → create
dev(orsaucedemo). - Set
base_url=https://www.saucedemo.com(required forNavigate to {{base_url}}).
4) Create an API key
- Settings → API keys → create key (
tn_…).
5) Install and configure CLI
npm install -g @testneo/cli
Production:
testneo config set baseUrl https://app.testneo.ai
testneo config set webAppUrl https://app.testneo.ai
testneo config set apiKey tn_your_key
testneo config set projectId 47
testneo config set defaultEnvironment dev
testneo doctor
Local API (optional):
testneo config set baseUrl http://127.0.0.1:8001
testneo config set webAppUrl http://127.0.0.1:5173
# same apiKey if valid on local DB; worker must be running
testneo doctor should show ✓ API reachable and list projects.
Working example (Sauce Demo)
Create login.testneo:
# Test: Sauce Demo login smoke
# Project: 47
# Environment: dev
Navigate to {{base_url}}
Enter username as "standard_user"
Enter password as "secret_sauce"
Click on Login button
Verify "Products" is visible
Run:
testneo run login.testneo --wait --fail-on-error
Expected: step list + result: PASSED + open run: path and full URL: for the dashboard.
Explicit URL (no {{base_url}} in project env): use examples with a hard-coded URL after install — samples ship under node_modules/@testneo/cli/examples/saucedemo/.
Hybrid (NLP + Playwright Code: block):
testneo run examples/saucedemo/add-backpack-hybrid.testneo --env dev --wait --fail-on-error
Commands
| Command | Description |
|---|---|
testneo doctor | Validate API key and list projects |
testneo config set … | Save ~/.config/testneo/config.json (baseUrl, apiKey, projectId, defaultEnvironment, webAppUrl) |
testneo config show | Show effective config (key masked) |
testneo run <file.testneo | dir> | Execute flow(s) |
testneo status <execution_id> [--wait] | Poll status |
testneo run flags
| Flag | Description |
|---|---|
--project <id> | Override project ID |
--env <name> | Environment name (e.g. dev) |
--wait | Poll until done (exit 1 on failure) |
--fail-on-error | With --wait, exits non-zero on failure |
--use-agent | Route to self-hosted TestNeo agent |
--timeout <ms> | Max wait (default 600000) |
.testneo file format
# Test: My flow
# Project: 47
# Environment: dev
# Tags: smoke
Navigate to {{base_url}}
Click on "Sign in"
Verify "Dashboard" is visible
Code:
await page.locator('[data-test="submit"]').click()
End Code:
Same format as the TestNeo VS Code extension.
CI (GitHub Actions)
- name: TestNeo smoke
run: testneo run tests/smoke/ --wait --fail-on-error
env:
TESTNEO_BASE_URL: https://app.testneo.ai
TESTNEO_WEB_APP_URL: https://app.testneo.ai
TESTNEO_API_KEY: ${{ secrets.TESTNEO_API_KEY }}
TESTNEO_PROJECT_ID: "47"
Environment variables
| Variable | Purpose |
|---|---|
TESTNEO_BASE_URL | API origin (overrides config) |
TESTNEO_WEB_APP_URL | Dashboard links in CLI output |
TESTNEO_API_KEY | Bearer token |
TESTNEO_PROJECT_ID | Default project |
TESTNEO_DEFAULT_ENV | Default environment name |
Troubleshooting
| Issue | Fix |
|---|---|
401 Invalid API key | Key from same environment as baseUrl; run testneo doctor |
[pending] 0/? long time | Start API worker; open dashboard URL from CLI output |
| Wrong host in URLs | testneo config set baseUrl / webAppUrl for prod vs local |
| Need Playwright in repo | Use @testneo/playwright-ai-sdk |