TestNeo CLI v0.3.0
Release assurance in your terminal — run .testneo tests, pick cases from Test Manager,
validate PRs, run API Risk Discovery (paste cURL), query Engineering Memory, check release readiness, and Ask the AI Assistant.
Same account and projects as app.testneo.ai
and MCP.
Install: npm install -g @testneo/cli@0.3.0 ·
Package: @testneo/cli ·
App: app.testneo.ai
npm install -g @testneo/cli@0.3.0
testneo login
testneo config set baseUrl https://app.testneo.ai
testneo config set webAppUrl https://app.testneo.ai
testneo config set projectId YOUR_PROJECT_ID
testneo config set defaultEnvironment dev
testneo doctor
# Run an exported .testneo file (cloud execution — safe default for most users)
testneo run ./login.testneo --project YOUR_PROJECT_ID --env dev --cloud --wait --fail-on-error
# Before you merge (from your application git repo)
testneo pr validate --project YOUR_PROJECT_ID
testneo readiness --project YOUR_PROJECT_ID
testneo ask --project YOUR_PROJECT_ID "What is my release readiness?"
Get started free (14-day trial) · Release Intelligence product overview
Also from TestNeo — pick your surface
| Package / surface | Use when |
|---|---|
@testneo/cli (this doc) | Terminal & CI — humans + scripts: run tests, API Risk Discovery, PR brief, memory, readiness, Ask |
| @testneo/playwright-ai-sdk | Playwright in Git + CI — ai.run in TypeScript specs |
| @testneo/mcp-server | Cursor / Claude — generate, triage, release workflows from chat |
| TestNeo app | Projects, Test Manager, live runs, PR boards, Release Readiness UI |
Getting started
Point the CLI at https://app.testneo.ai. Do this once.
1) Sign up & create a project
- app.testneo.ai/signup — create an account (14-day trial).
- Projects → Create project.
- Note your project ID (shown in the app or via
testneo doctor).
2) Environment + API key
- Project → Environments → create
devwith abase_urlfor the app under test (example:https://www.saucedemo.com). - Settings → API keys → create a key (
tn_…).
3) Install & configure
npm install -g @testneo/cli@0.3.0
testneo login
# or: testneo config set apiKey tn_your_key
testneo config set baseUrl https://app.testneo.ai
testneo config set webAppUrl https://app.testneo.ai
testneo config set projectId YOUR_PROJECT_ID
testneo config set defaultEnvironment dev
testneo doctor
Expect ✓ API reachable and your projects listed. Dashboard links in CLI output will use
https://app.testneo.ai/….
4) Export tests from Test Manager (recommended)
- Open Test Manager → select cases → Export → TestNeo CLI → unzip.
- Run the exported file (see examples below).
Which command should I use?
| Goal | Command | Notes |
|---|---|---|
| Run a saved NLP file | testneo run ./my.testneo --cloud --wait |
Best for exports from Test Manager |
| Run an existing Test Manager case by ID | testneo run --test-case 12 --cloud --wait |
Does not create a duplicate case |
| Browse & multi-select cases | testneo run --pick --cloud --wait |
Interactive (TTY) |
| Quick one-shot NLP (no file) | testneo try "…" --url https://… --cloud --wait |
Creates/updates a case by name, then runs it |
| Headed browser on your machine | Add --use-agent (agent must be online) |
See Local agent vs cloud |
| Paste cURL → API risk variants | testneo api-risk scan -f file.curl --cloud |
Discover → run → brief; add --promote --confirm to remember |
| CI / no local agent | Always pass --cloud |
Recommended in GitHub Actions |
Avoid surprise duplicates: testneo run path/to/file.testneo upserts by
file name (without .testneo). If that name differs from the case in Test Manager,
a new case is created. To always run the original case, use
testneo run --test-case ID --cloud --wait or --pick.
Sample project journey (end-to-end)
Walkthrough for a typical web project (Sauce Demo–style login + catalog).
Replace YOUR_PROJECT_ID with your ID from testneo doctor.
- 1 · Smoke — Prove auth & execution with
run/try. - 2 · Inventory — Ask “how many tests?” / “which tests cover login?”
- 3 · Diff risk — From your app git repo:
memory match+pr validate. - 4 · Ship decision —
readiness+ Ask “safe to ship?” / release decision report. - 5 · CI — Same commands in GitHub Actions with secrets.
P=YOUR_PROJECT_ID # from: testneo doctor
# --- 1) Smoke (cloud — works without a local agent) ---
testneo try --project $P --env dev --cloud --wait --fail-on-error \
--url https://www.saucedemo.com \
"Enter username as standard_user
Enter password as secret_sauce
Click Login
Verify Products is visible"
# Or run an exported / example file
testneo run "$(npm root -g)/@testneo/cli/examples/saucedemo/login-explicit-url.testneo" \
--project $P --env dev --cloud --wait --fail-on-error
# Or run existing Test Manager cases (no new cases created)
testneo run --pick --project $P --cloud --wait --fail-on-error
# testneo run --test-case 12,34 --project $P --cloud --wait --fail-on-error
# --- 2) Inventory (Ask) ---
testneo ask --project $P "How many test cases do I have?"
testneo ask --project $P "Which tests cover login?"
testneo ask --project $P "List all test cases"
testneo ask --project $P --chat # interactive; type questions, exit to quit
# --- 2) API Risk Discovery (FakeStore sample after npm install) ---
testneo api-risk scan --project $P \
--file "$(npm root -g)/@testneo/cli/examples/api-risk/fakestore-products.curl" \
--cloud --fail-on-critical --brief-out api-confidence.md
# Promote failures → Risk_* NLP + Engineering Memory (write guard)
# testneo api-risk run --project $P -f that.curl --cloud --json > run.json
# testneo api-risk promote --project $P --run-file run.json --confirm
# --- 3) PR / memory (run from the *application* git repo) ---
cd /path/to/your-app-repo
testneo memory match --project $P
testneo pr validate --project $P
# optional: execute impacted tests on cloud (write guard)
testneo pr validate --project $P --run-impacted --confirm --cloud --wait --fail-on-error
testneo pr history --project $P
# --- 4) Release readiness ---
testneo readiness --project $P
testneo ask --project $P "What is my release readiness?"
testneo ask --project $P "Show release metrics"
testneo ask --project $P "Generate release decision report"
testneo ask --project $P "Is it safe to ship?"
Important: pr validate and memory match use local git (base/head SHAs + changed files).
Run them from your application repository, not a random unrelated checkout — otherwise impact scoring is empty.
Run · pick · try
All three execute NLP against your project on app.testneo.ai.
Prefer --cloud unless you intentionally use a local agent (next section).
File / folder run
# Cloud (recommended default)
testneo run ./login.testneo --project YOUR_PROJECT_ID --env dev --cloud --wait --fail-on-error
testneo run ./tests/smoke/ --project YOUR_PROJECT_ID --env dev --cloud --wait --fail-on-error
# Local agent (headed browser on your machine — agent must be online)
testneo run ./login.testneo --project YOUR_PROJECT_ID --env dev --use-agent --wait --fail-on-error
Bundled Sauce Demo sample (after global install):
testneo run "$(npm root -g)/@testneo/cli/examples/saucedemo/login-explicit-url.testneo" \
--project YOUR_PROJECT_ID --env dev --cloud --wait --fail-on-error
Pick Test Manager cases (TTY)
testneo run --pick --project YOUR_PROJECT_ID --cloud --wait --fail-on-error
# filter: testneo run --pick --search login --cloud --wait
Run by ID (no duplicate cases — best for CI)
testneo run --test-case 12,34 --project YOUR_PROJECT_ID --env dev --cloud --wait --fail-on-error
One-shot natural language (try)
No .testneo file — NLP as arguments. Upserts a case by name, then executes.
testneo try --project YOUR_PROJECT_ID --env dev --cloud --wait --fail-on-error \
--url https://www.saucedemo.com \
"Enter username as standard_user
Enter password as secret_sauce
Click Login
Verify Products is visible"
Live steps stream in the terminal; open the printed dashboard URL on app.testneo.ai.
Status
testneo status EXECUTION_ID --wait
Local agent vs cloud
Every execute prints a line like execution: cloud / EC2 (--cloud) or
execution: local agent #12 … so you always know where the browser ran.
| Flag / setting | When to use | What happens |
|---|---|---|
--cloud |
Recommended for CI and most users | Always run on TestNeo cloud (EC2) — no local agent needed |
--use-agent |
You want a headed browser on your laptop | Force local agent (start it first in the app) |
Neither flag (preferAgent: true default) |
Optional convenience | Local agent if online (heartbeat ≤ 90s), otherwise cloud |
config set preferAgent false |
Always prefer cloud unless you pass --use-agent |
Same effect as defaulting to cloud |
# Check whether a local agent is registered / online
testneo agent status
testneo doctor
# --- Cloud (pin it — clearest for demos & CI) ---
testneo run ./login.testneo --project YOUR_PROJECT_ID --env dev --cloud --wait --fail-on-error
testneo run --pick --project YOUR_PROJECT_ID --cloud --wait
testneo try --project YOUR_PROJECT_ID --cloud --url https://www.saucedemo.com \
"Verify Products is visible" --wait
# --- Local agent ---
# 1) In app.testneo.ai → Settings → Agent → create & start the agent
# 2) Confirm:
testneo agent status
# 3) Run:
testneo run ./login.testneo --project YOUR_PROJECT_ID --env dev --use-agent --wait --fail-on-error
testneo run --pick --project YOUR_PROJECT_ID --use-agent --wait --fail-on-error
Do not confuse flags:
--use-agent/--cloud= where the browser runs--agent(global) = output mode (NDJSON for coding agents / scripts) — unrelated to local agent routing
API Risk Discovery — paste cURL
Deterministic risk variants from a single cURL (no LLM). Same backend as
API Testing → Risk in the app and MCP testneo_api_risk_* tools.
Product overview: API automation — Risk Discovery
· MCP recipe: Workflow 13.
Commands
| Command | What it does |
|---|---|
testneo api-risk discover | Parse cURL → variant list. Does not call the target API |
testneo api-risk run | Execute variants (--cloud or --use-agent). Write-guarded with gates |
testneo api-risk brief | Export API Confidence Brief (markdown / json) |
testneo api-risk promote | Failures → Risk_* NLP tests + Engineering Memory (--confirm) |
testneo api-risk scan | One-shot discover + run (+ optional --brief-out / --promote --confirm) |
Flags
| Flag | Description |
|---|---|
-p, --project <id> | Project ID |
-f, --file <path> | Read cURL from file (relative to cwd) |
--curl <text> | cURL string; use - for stdin |
--max-variants <n> | Max variants (default 40; prefer ≤20 for local agent) |
--injection | Include allowlisted injection probes |
--cloud / --use-agent | Force cloud or local agent for HTTP runs |
--body-oracles | Enable experimental body_v1 oracles |
--fail-on-critical | Exit 1 if any critical finding (CI gate) |
--min-confidence <n> | Exit 1 if confidence < N (0–100) |
--brief-out <path> | Write Confidence Brief markdown after run/scan |
--promote + --confirm | On scan: create Risk_* tests + EM (both required) |
--no-remember | With promote, skip Engineering Memory ingest |
--json (global) | Emit machine-readable result (save as run.json for promote) |
All examples (copy-paste)
P=YOUR_PROJECT_ID
SAMPLE="$(npm root -g)/@testneo/cli/examples/api-risk/fakestore-products.curl"
# From monorepo after build: SAMPLE=examples/api-risk/fakestore-products.curl
# --- Discover only (no HTTP to target) ---
testneo api-risk discover --project $P --file "$SAMPLE"
testneo api-risk discover --project $P --file "$SAMPLE" --json
testneo api-risk discover --project $P --curl - --max-variants 20 < "$SAMPLE"
testneo api-risk discover --project $P --file "$SAMPLE" --injection
# --- Run (cloud) ---
testneo api-risk run --project $P --file "$SAMPLE" --cloud
testneo api-risk run --project $P --file "$SAMPLE" --cloud --max-variants 10
testneo api-risk run --project $P --file "$SAMPLE" --cloud --fail-on-critical
testneo api-risk run --project $P --file "$SAMPLE" --cloud --min-confidence 50
testneo api-risk run --project $P --file "$SAMPLE" --cloud --brief-out api-confidence.md
testneo api-risk run --project $P --file "$SAMPLE" --cloud --body-oracles
testneo api-risk run --project $P --file "$SAMPLE" --cloud --json > run.json
# --- Run (local agent) ---
testneo agent status
testneo api-risk run --project $P --file "$SAMPLE" --use-agent --max-variants 20 --timeout 90
# --- One-shot scan ---
testneo api-risk scan --project $P --file "$SAMPLE" --cloud \
--fail-on-critical --brief-out api-confidence.md
testneo api-risk scan --project $P --file "$SAMPLE" --cloud \
--fail-on-critical --brief-out api-confidence.md \
--promote --confirm
testneo api-risk scan --project $P --file "$SAMPLE" --use-agent --max-variants 20 \
--brief-out api-confidence.md
# --- Brief from saved run or run_id ---
testneo api-risk brief --project $P --run-file run.json --out api-confidence.md
testneo api-risk brief --project $P --run-id RUN_UUID --format markdown
testneo api-risk brief --project $P --run-file run.json --format json --out brief.json
# --- Promote (Remember) ---
testneo api-risk promote --project $P --run-file run.json --confirm
testneo api-risk promote --project $P --run-file run.json --confirm --no-remember
testneo api-risk promote --project $P --run-file run.json --confirm --remember-warnings
FakeStore note: demos often return 201 on bad input, so confidence can be
0 with many criticals — that is expected for the sample. Promote creates one
Risk_* NLP case per failure (use --max-variants 10 for a smaller demo).
Open the brief, then check project → API tests and Engineering Memory.
Typical next step after a successful scan
# You already have a brief. Save a run JSON, then promote:
node dist/cli.js api-risk run -p 6 -f examples/api-risk/fakestore-products.curl --cloud --json > run.json
node dist/cli.js api-risk promote -p 6 --run-file run.json --confirm
# Or one-shot re-scan + promote:
node dist/cli.js api-risk scan -p 6 -f examples/api-risk/fakestore-products.curl --cloud \
--brief-out api-confidence.md --promote --confirm
PR validate — Release Brief
Builds a Release Brief from local git (or a connected GitHub PR): risk level (PASS / WARN / BLOCK), impacted tests, Engineering Memory matches, and a board URL. Product deep-dive: Release Intelligence.
# From your app repo (must have commits + origin/main or origin/master)
cd /path/to/your-app
testneo pr validate --project YOUR_PROJECT_ID
# prints brief + workflow_id + https://app.testneo.ai/web/pr-validation/<id>
# Connected GitHub PR number
testneo pr validate --project YOUR_PROJECT_ID --pr 142
# Run impacted tests (requires explicit --confirm)
testneo pr validate --project YOUR_PROJECT_ID --run-impacted
# → errors without --confirm (write guard)
testneo pr validate --project YOUR_PROJECT_ID \
--run-impacted --confirm --wait --fail-on-error
# Force cloud for impacted runs (CI / no local agent)
testneo pr validate --project YOUR_PROJECT_ID \
--run-impacted --confirm --cloud --wait
testneo pr history --project YOUR_PROJECT_ID --limit 5
What to look for: 🟢 PASS / 🟡 WARN / 🔴 BLOCK · risk score · historical incident matches · merge recommendation · open the board link for the full UI.
Engineering Memory
Prior incidents, patterns, and live matches against your current diff.
cd /path/to/your-app
testneo memory match --project YOUR_PROJECT_ID # score / tier vs current changes
testneo memory list --project YOUR_PROJECT_ID # stored entries
testneo memory patterns --project YOUR_PROJECT_ID # clustered patterns
Use match before merge when you want a fast “have we broken this area before?” signal; use pr validate for the full brief.
Release readiness
Project-level confidence (0–100) and recommendation (e.g. SAFE TO RELEASE).
testneo readiness --project YOUR_PROJECT_ID
testneo readiness --project YOUR_PROJECT_ID --json # scripts / CI
# Same question via Ask (narrative + links)
testneo ask --project YOUR_PROJECT_ID "What is my release readiness?"
testneo ask --project YOUR_PROJECT_ID "Show release metrics"
testneo ask --project YOUR_PROJECT_ID "Generate release decision report"
UI board: app.testneo.ai/web/release-readiness
Ask — AI Assistant in the terminal
Same endpoint as web /web/ai-assistant and MCP testneo_ai_assistant_query.
Operational questions (inventory, readiness, navigate, k6/codegen) are answered from your project data via the server command router — not a hard-coded FAQ.
Modes
testneo ask --project YOUR_PROJECT_ID "How many test cases do I have?"
testneo ask --project YOUR_PROJECT_ID --detailed "Give me an executive summary"
testneo ask --project YOUR_PROJECT_ID --json "List all test cases"
testneo ask --project YOUR_PROJECT_ID --chat
In --chat, type the question only (e.g. Go to dashboard). Pasting a full testneo ask … line also works — the CLI strips the wrapper.
High-value questions
| Ask | You get |
|---|---|
How many test cases do I have? | Live Test Manager count |
List all test cases | IDs + names |
Which tests cover login? / Products and Coupons | Coverage-style matches (name, tags, NLP) |
Show latest test run results | Recent executions |
Show project statistics | Counts + pass/fail tallies |
What is my release readiness? | Confidence /100 + decision |
Show release metrics | PR window + score factors |
Generate release decision report | Checklist + rollback-style brief |
Is it safe to ship? / Can I release? | Ship recommendation |
Open test manage / Go to dashboard | Absolute UI links in the terminal |
Generate k6 load test for GET /products | Load script (not test inventory) |
Give me an executive summary | LLM analytics path (richer with uploaded docs) |
Interactive chat script
testneo ask --project YOUR_PROJECT_ID --chat
How many test cases do I have?Which tests cover login?Show latest test run resultsWhat is my release readiness?Generate release decision reportOpen release readinessexit
Demo reel — Ask loop (copy-paste)
Walk inventory → latest runs → readiness → ship decision → UI link.
Great for demos. Set P to your project ID from testneo doctor.
P=YOUR_PROJECT_ID
for q in \
"How many test cases do I have?" \
"List all test cases" \
"Which tests cover login?" \
"Show latest test run results" \
"What is my release readiness?" \
"Show release metrics" \
"Generate release decision report" \
"Is it safe to ship?" \
"Open release readiness"
do
echo ""
echo "════════ $q ════════"
testneo ask --project "$P" "$q"
sleep 2
done
Navigate answers print absolute links under https://app.testneo.ai/…
(from your webAppUrl config).
Commands reference (v0.3.0)
| Command | Description |
|---|---|
testneo doctor | Validate API key + list projects + agent routing hint |
testneo login | Email/password → create tn_ key → save config |
testneo config set|show|path | ~/.config/testneo/config.json (incl. preferAgent) |
testneo run | File/dir, --pick, or --test-case |
testneo try "…" | One-shot NL → upsert + execute |
testneo agent status | Local agent registered / online? (drives smart routing) |
testneo status <id> | Poll execution |
testneo pr validate | Release Brief (local git or --pr) |
testneo pr history | Recent validation boards |
testneo memory list|patterns|match | Engineering Memory |
testneo api-risk scan | Dev team: paste cURL → discover + run (+ brief / promote) |
testneo api-risk discover|run|brief|promote | Stepwise Risk Discovery (CI-friendly) |
testneo readiness | Release confidence summary |
testneo ask ["…"] | AI Assistant (--chat, --detailed) |
testneo tui | Interactive home (pick → validate → run) |
Global flags
| Flag | Description |
|---|---|
--json | Single JSON object (CI / scripts) |
--agent | NDJSON event stream for coding agents (output mode — not local-agent routing) |
run / try / impacted PR flags
| Flag | Description |
|---|---|
--project <id> | Override project ID |
--env <name> | Environment name |
--wait | Poll until done |
--fail-on-error | Non-zero exit on failure (with --wait) |
--use-agent | Force local TestNeo agent |
--cloud | Force cloud / EC2 (skip local agent) |
--timeout <ms> | Max wait (default 600000) |
--pick / --search / --test-case | Cloud case selection |
--url (try) | Explicit start URL |
TUI & NDJSON agent mode
testneo tui
testneo try "Verify Products is visible" --wait --agent
# → NDJSON events, then a final result line
.testneo file format
# Test: Sauce Demo login smoke
# Project: YOUR_PROJECT_ID
# Environment: dev
# Tags: smoke
Navigate to {{base_url}}
Enter username as "standard_user"
Enter password as "secret_sauce"
Click on Login button
Verify "Products" is visible
Code:
await page.locator('[data-test="add-to-cart-sauce-labs-backpack"]').click()
End Code:
Same NLP as the VS Code extension and Test Manager.
CI (GitHub Actions)
- name: TestNeo smoke
run: |
npm install -g @testneo/cli@0.3.0
testneo run tests/smoke/ --cloud --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"
TESTNEO_PREFER_AGENT: "false"
- name: API Risk Discovery (optional)
run: |
testneo api-risk scan --project ${{ env.TESTNEO_PROJECT_ID }} \
--file node_modules/@testneo/cli/examples/api-risk/fakestore-products.curl \
--cloud --fail-on-critical --brief-out api-confidence.md
env:
TESTNEO_BASE_URL: https://app.testneo.ai
TESTNEO_API_KEY: ${{ secrets.TESTNEO_API_KEY }}
TESTNEO_PROJECT_ID: "47"
- name: PR release brief (optional)
run: |
testneo pr validate --project ${{ env.TESTNEO_PROJECT_ID }} --json
env:
TESTNEO_BASE_URL: https://app.testneo.ai
TESTNEO_API_KEY: ${{ secrets.TESTNEO_API_KEY }}
TESTNEO_PROJECT_ID: "47"
# checkout must include full git history for local impact
Environment variables
| Variable | Purpose | Typical value |
|---|---|---|
TESTNEO_BASE_URL | API origin | https://app.testneo.ai |
TESTNEO_WEB_APP_URL | Dashboard / board links in CLI output | https://app.testneo.ai |
TESTNEO_API_KEY | Bearer token | tn_… |
TESTNEO_PROJECT_ID | Default project | from testneo doctor |
TESTNEO_DEFAULT_ENV | Default environment name | dev |
TESTNEO_PREFER_AGENT | Smart local-agent routing when flags omitted | true (default) / false |
Troubleshooting
| Issue | Fix |
|---|---|
401 Invalid API key | Key must match https://app.testneo.ai; re-run testneo login / doctor |
[pending] 0/? for a long time | Open the dashboard URL from CLI output on app.testneo.ai; ensure agent is online if using --use-agent |
| Wanted cloud but got local agent | Pass --cloud (or config set preferAgent false) |
| Wanted local agent but got cloud | testneo agent status — start agent in app Settings; heartbeat ≤90s; then --use-agent |
Extra / duplicate test case after run file.testneo | Upsert is by file name. Use --test-case ID or --pick to run the original case |
| Empty PR brief / score 0 | Run from the application git repo with origin/main (or master); fetch remotes |
--run-impacted errors | Add --confirm (write guard) |
| Ask returns upload/welcome blurb | Use inventory questions above; upgrade CLI to 0.3.0 |
| Navigate shows relative path only | Set webAppUrl to https://app.testneo.ai; upgrade to 0.3.0 |
--pick in CI | Use --test-case id (non-TTY) |
| Wrong host in dashboard links | testneo config set baseUrl https://app.testneo.ai and webAppUrl https://app.testneo.ai |
Curl file not found: …/req.curl | Pass a real path: -f examples/api-risk/fakestore-products.curl (or your own file). Paths are relative to the current working directory |
…/packages/testneo-cli/packages/testneo-cli/dist/cli.js | Relative alias — unalias testneo, then alias testneo="node $(pwd)/dist/cli.js" from packages/testneo-cli, or use node dist/cli.js |
api-risk unknown / old CLI | Global may be 0.1.x — use node dist/cli.js from the monorepo build, or npm i -g @testneo/cli@latest after publish |
| Confidence 0 + many criticals on FakeStore | Expected — FakeStore often returns 201 on bad input. Use --max-variants 10 before promote for a smaller demo |
| Still on old CLI | npm i -g @testneo/cli@0.3.0 then which testneo / testneo --version |