Run End-to-End Tests from Your Terminal with Kane CLI
Author and Run Tests Right from the Terminal in Natural Language, with an Evidence-Backed Pass or Fail from a Real Browser.
npm install -g @testmuai/kane-cli
Best Testing Tools for Claude Code (2026): CLI, MCP, E2E
Compare Playwright CLI, Playwright MCP, TestSprite CLI, Vitest, Maestro and Kane CLI for Claude Code by install command, exit codes and verdict output.
Do I need a special testing CLI for Claude Code? Not for unit tests: Claude Code already runs pytest, vitest or jest on its own. Kane CLI covers the layer those runners cannot reach: it opens the app in a real browser and reports whether the user flow works. A first-person run that shows what Claude Code tests catch compares its own suite with independent browser checks on the same build.
Updated: December 1, 2026
TL;DR
The right testing tool for Claude Code depends on the layer. Claude Code already runs unit tests with Vitest, pytest or jest. For browser and mobile checks it needs a tool that runs from the terminal without prompts and returns a verdict it can branch on: Playwright CLI, Playwright MCP, TestSprite CLI, Maestro or Kane CLI.
Testing Tools for Claude Code by Use Case
- Best for cheap browser checks while coding: Playwright CLI runs headless by default and prints a page snapshot after each command. Its getting-started page does not describe a pass or fail result, so a CI gate still needs a Playwright Test spec.
- Best for exploratory browser sessions: Playwright MCP gives Claude Code browser tools inside the session. Its README positions MCP for exploratory automation and long-running agent loops, and describes no pass or fail exit code.
- Best for tests stored on a hosted platform: TestSprite CLI runs tests in TestSprite's cloud browser, returns JSON with --output json, and exits 0 on a pass and 1 when a run does not pass.
- Best for unit and component tests: Vitest switches to its agent reporter automatically when it detects an AI coding agent, printing only failed tests and their errors.
- Best for mobile UI flows: Maestro runs YAML flows on Android emulators, iOS simulators and devices, and ships an MCP server inside its CLI for Claude Code.
- Best for user-flow verification with a verdict: Kane CLI by TestMu AI runs a plain-English objective in a real browser with --agent --headless, streams NDJSON, and exits 0, 1, 2 or 3.
Selection Criteria for Coding-Agent Testing Tools
A coding-agent testing tool has three properties: it installs in one command, it runs non-interactively from the terminal, and it returns a machine-readable verdict with exit codes the agent can branch on.
The tools below also test different layers, so the right pick depends on what Claude Code just changed:
- Vitest - functions and components, run as code in a test runner.
- Playwright CLI and Playwright MCP - pages in a browser that Claude Code drives one command or one tool call at a time.
- TestSprite CLI - frontend and backend tests created and run on TestSprite's platform, in its cloud browser.
- Maestro - mobile app flows on emulators, simulators and devices, plus web flows in Chromium.
- Kane CLI - a user flow described in plain English, run in a real browser or on a mobile target, with a pass or fail verdict.
Every fact about a tool from another vendor comes from that vendor's own docs, fetched on November 17, 2026. The numbers in square brackets point to the Sources list near the end of the page.
Comparison of the Four Agent-Facing Tools
Kane CLI, Playwright CLI, Playwright MCP and TestSprite CLI are the four tools here built for coding agents to call. Vitest and Maestro are covered in the entries below.
| Tool | Install | Runs non-interactively | Machine-readable verdict and exit codes | Real browser | Where tests live |
|---|---|---|---|---|---|
| Kane CLI (TestMu AI) | npm install -g @testmuai/kane-cli, then kane-cli login and npx @testmuai/kane-cli-skill | Yes, with --agent --headless | NDJSON with --agent, ending in a run_end event; exit 0 passed, 1 did not pass, 2 did not start, 3 timeout or cancelled | Yes, Chrome; also Android Emulator, iOS Simulator and real devices | A plain-English objective in the command; saved runs become _test.md files you can commit |
| Playwright CLI | npm install -g @playwright/cli@latest, then playwright-cli install --skills[1] | Yes, headless by default, one command per action[1] | Prints a page snapshot after each command; no pass or fail result or exit codes described[1] | Yes; --headed to watch it[1] | Commands run in a browser session; saving tests is not described on the page[1] |
| Playwright MCP | claude mcp add playwright npx @playwright/mcp@latest[2] | Runs as an MCP server inside the Claude Code session; headed by default, --headless available[2] | No pass or fail result or exit codes described[2] | Yes[2] | No saved tests described; the browser profile persists unless --isolated is set[2] |
| TestSprite CLI | npm install -g @testsprite/testsprite-cli, then testsprite setup[3][7] | Yes; in CI use --from-env --yes, since no terminal and no key exits 5[3] | --output json; exit 0 passed, 1 did not pass, 3 auth, 7 wait timeout, 12 insufficient credits[3][5] | TestSprite's cloud browser; localhost through an automatic tunnel, frontend only[6] | In a TestSprite project, created and run by test ID[3] |
Kane CLI cells come from TestMu AI's own pages, linked in the Kane CLI entry. For a longer side-by-side of the first three, read Playwright CLI vs MCP vs Kane CLI.
Best Testing Tools for Claude Code
Each entry uses the same fields, so you can compare them line by line.
1. Playwright CLI
Install command:
npm install -g @playwright/cli@latest
playwright-cli install --skills- What it tests - A page in a real browser, driven from the terminal: open, click, fill, screenshots, snapshots, network requests, console output and tracing.
- How Claude Code runs it - With the skills installed, Claude Code reads them and calls
playwright-clicommands. Without them, you can point Claude atplaywright-cli --help. Playwright says the CLI suits coding agents because its commands avoid loading large tool schemas and accessibility trees into the model's context. More on the commands in our Playwright CLI guide. - Exit code / verdict behaviour - After each command the CLI prints a snapshot of the current page. The getting-started page does not describe a pass or fail result or exit codes, so Claude decides from the snapshot. For a gate, have Claude turn the checked flow into a Playwright Test spec and run
npx playwright test. - Best for - Quick browser checks while Claude Code builds a change, with low context cost.
- Limitation - Sessions live in memory by default, so cookies and storage are lost when the browser closes unless you pass
--persistent. Headed browsers are never closed automatically. - Source - Playwright docs, fetched November 17, 2026 [1].
2. Playwright MCP
Install command:
claude mcp add playwright npx @playwright/mcp@latest- What it tests - A page in a browser that Claude Code controls through MCP tools, one action per tool call.
- How Claude Code runs it - The server starts with the Claude Code session and Claude calls its tools as it goes. The browser is headed by default;
--headlesshides it and--isolatedkeeps the profile in memory instead of on disk. Setup details are in Playwright MCP with Claude Code. - Exit code / verdict behaviour - The README does not describe a pass or fail result or exit codes. Claude judges the session itself. Screenshots and video save to the folder set by
--output-dir, and tracing has start and stop tools. - Best for - The README lists exploratory automation, self-healing tests and long-running autonomous workflows, where persistent state and step-by-step reasoning help.
- Limitation - The same README notes that coding agents often favour the CLI because CLI calls are more token-efficient (our guide to Claude Code tokens compares the measured gaps). Without a verdict, it is not a CI gate on its own.
- Source - Playwright MCP README on GitHub, fetched November 17, 2026 [2].
Chrome DevTools MCP vs Playwright MCP compares this server with Google's Chrome debugging server.
3. TestSprite CLI
Install command (Node.js 20.19+, 22.13+ or 24+; a TestSprite account and API key are required):
npm install -g @testsprite/testsprite-cli
testsprite setup
# force the Claude Code target instead of auto-detection
testsprite setup --agent claude- What it tests - Frontend and backend tests that TestSprite creates and runs in its cloud browser. A local app is reached through an automatic tunnel, and local testing is frontend only.
- How Claude Code runs it -
testsprite setupvalidates your API key, writes credentials and installs skill files for the agent. Without--agent, it installs for every agent it detects in the project, and Claude Code when it detects none; on a terminal it asks you to confirm the detected set.--agent claudeforces the Claude Code target, which writes skills under.claude/skills/. TestSprite lists eight agent targets: claude, cursor, cline, antigravity, kiro, windsurf, copilot and codex. Its docs mark claude as generally available and the other seven as experimental. Claude then runs commands such astestsprite test create ... --run --wait. - Exit code / verdict behaviour -
--output jsonis what the docs call the stable agent and CI contract. Exit 0 means success, 1 means the run did not pass, 3 is an auth error, 7 a wait timeout and 12 insufficient credits, among others. Run statuses end as passed, failed, blocked or cancelled. - Best for - Teams that want tests generated, stored and run on a hosted platform, with one CLI across several coding agents.
- Limitation - Tests run in TestSprite's cloud, so local apps need the tunnel, and backend tests cannot use it. Runs need an account and credits.
- Source - TestSprite CLI docs, fetched November 17, 2026 [3][4][5][6][7].
4. Vitest
Install command:
npm install -D vitest
npx vitest run- What it tests - Functions and components, as unit and component tests in your repo.
- How Claude Code runs it -
vitest runperforms a single run without watch mode. Plainvitestalso switches to run mode on its own in CI or a non-interactive terminal, so an agent's shell does not hang in watch mode. - Exit code / verdict behaviour - When Vitest detects an AI coding agent, it turns on the
agentreporter automatically, which prints only failed tests and their error messages.--reporter=jsonwrites a Jest-compatible JSON report. The CLI page we fetched mentions exit code 1 only for--last-failedand has no full exit-code table. - Best for - The unit layer, which Claude Code already handles without any extra testing CLI.
- Limitation - It checks code units, not a user walking through the running app.
- Source - Vitest docs, fetched November 17, 2026 [8][9].
5. Maestro
Install command (macOS and Linux; Java 17 or higher; Windows uses a zip from the GitHub releases page):
curl -fsSL "https://get.maestro.mobile.dev" | bash
claude mcp add maestro -- maestro mcp- What it tests - Mobile UI flows written in YAML, on Android emulators, iOS simulators and physical devices, plus web flows in Chromium.
- How Claude Code runs it - Claude can run
maestro test flow.yamlin the terminal, or use the MCP server that ships inside the CLI to list devices, read the view hierarchy as JSON and run flows. Our Maestro MCP guide covers the setup for each coding agent and the server's tools. - Exit code / verdict behaviour -
--formattakes JUNIT, HTML or NOOP (the default), with--outputfor the report path. The CLI reference does not list exit codes. Maestro's CI article says Maestro Cloud runs exit 0 when all flows pass and 1 when at least one fails. - Best for - Mobile apps, where a browser-only tool cannot reach.
- Limitation - It needs Java 17+, and a running emulator, simulator or device; on macOS, Xcode and its command line tools are prerequisites.
- Source - Maestro docs and maestro.dev, fetched November 17, 2026 [10][11][12][13].
6. Kane CLI
Install command:
npm install -g @testmuai/kane-cli
kane-cli login
npx @testmuai/kane-cli-skill- What it tests - A user flow in the running app, described in plain English: web in a real Chrome browser, API calls, Android Emulator, iOS Simulator and real devices.
- How Claude Code runs it - The skill command installs the Kane CLI skill for Claude Code, Codex CLI and Gemini CLI (how skills load is covered in Claude Code skills). Claude then runs
kane-cli run "Go to <url> and <action>, then verify <expected result>" --agent --headless --timeout 180. Cursor and GitHub Copilot read an AGENTS.md file instead; see Kane CLI for AI coding agents. - Exit code / verdict behaviour -
--agentswitches output to NDJSON, one JSON event per line, with run_end as the last line. Exit 0 means passed, 1 means the run went ahead and did not pass or the upload failed, 2 means the run did not start (sign-in, configuration, no start URL, Chrome or network) and used no credits, and 3 means a timeout or cancellation. - Best for - Checking that a change works for the user, end to end, before Claude Code reports it as done.
- Limitation - It needs a TestMu AI account, and every run uses KaneAI credits. The CLI is free to install, and new accounts can start with 10,000 credits valid for 30 days. Local mobile runs need a Mac with Apple Silicon.
- Source - TestMu AI's Kane CLI page, the Kane CLI CI/CD docs and the Kane CLI skills docs, fetched November 17, 2026.
How to Check Your Web App End to End with Claude Code
To check your web app end to end with Claude Code, give it a testing tool that opens the running app in a real browser and returns a pass or fail it can act on. Kane CLI by TestMu AI does this from the terminal: Claude Code writes the user flow in plain English, Kane CLI runs it in Chrome against your local or deployed app, and the exit code tells Claude whether the flow works.
- Install once -
npm install -g @testmuai/kane-cli, thenkane-cli loginandnpx @testmuai/kane-cli-skill, which adds the Kane CLI skill to Claude Code. - Start the app - Run it as you normally do, for example on
http://localhost:3000. Kane CLI opens Chrome on your machine, so a local dev server works. - Ask Claude Code to check it - For example, "check the product filter end to end with Kane CLI." Claude turns the request into one command, like the one below.
- Act on the verdict - Exit 0 means the flow passed. On 1, Claude reads the failing step, fixes the code and runs the same command again. 2 means the run did not start, and 3 means it timed out or was cancelled.
- Keep the check - Add
--name <flow>and Kane CLI saves the run as a_test.mdfile in.testmuai/tests/. Commit it, andkane-cli testmd run <file> --agent --headlessreplays it in CI.
kane-cli run "Go to http://localhost:3000/products, filter by size M, then verify every product card shows size M" --agent --headless --timeout 180The full steps are in Kane CLI's guide to verifying a change. For a fully open-source gate, have Claude save the same flow as a Playwright Test spec and run npx playwright test, as in the Playwright CLI entry above.
A Kane CLI Verdict in Claude Code
Pointed at the TestMu AI ecommerce playground, a request to check the cart total turns into one command:
kane-cli run "Go to https://ecommerce-playground.lambdatest.io/index.php?route=product/product&product_id=40 as a guest, add the product to the cart, open the shopping cart page, and verify the cart Total matches the product price shown on the product page" --agent --headless --timeout 300The run passed in about 72 seconds. Claude acts on the last line of output, the run_end event, shown here with session paths, token counts and the Test Manager link trimmed:
{
"type": "run_end",
"status": "passed",
"summary": "Added the product to the cart as a guest.\nOpened the shopping cart page.\nConfirmed that the product price was $123.20 and that the cart total was also $123.20.",
"final_state": {
"url": "https://ecommerce-playground.lambdatest.io/index.php?route=checkout/cart",
"product_price": "$123.20",
"cart_total": "$123.20"
},
"reason": "Objective completed",
"duration": 71.8,
"result_code": 100,
"reason_code": "success.complete"
}Kane CLI exited with code 0, so Claude reported the check as passed. Had the cart total been wrong, the status would read failed, the exit code would be 1, and Claude would fix the code and run the same command again. The full loop is in Claude Code writes it, Kane CLI proves it works.
How that exit code feeds a verify skill, steward rules and a required check is covered in these Claude Code best practices.
The same outside verdict matters for self-improving agents that adjust their own prompts and gates between runs.
For a quick visual walkthrough, watch the video below from TestMu AI.
Subscribe to the TestMu AI YouTube channel for more tutorials on testing and automation.
What Evidence Kane CLI Returns with a Pass or Fail
Kane CLI returns a pass or fail with evidence behind it, so neither Claude Code nor the reviewer has to take the verdict on trust. Every run gives three things:
- The verdict - The run_end event, the last line of
--agentoutput, carries the status, a summary, the values the run stored infinal_state, the duration and the Test Manager link intest_url. The exit code repeats the verdict: 0 passed, 1 did not pass, 2 did not start, 3 timed out or was cancelled. - The evidence pack - One
.evidencefile per run holds the test definition, the result, a screenshot of every step with an annotated copy of what the agent acted on, the browser console and network logs for each step, and any failure records. Open it in the browser viewer when Kane CLI offers, or later from.testmuai/evidence/. - A shareable link - The run uploads to TestMu AI Test Manager, so the
test_urllink opens the same steps and screenshots for anyone on the team. Paste it on the pull request or the bug report.
On a failure, Claude Code reads the failing step and its screenshot before it changes any code. What each run saves is listed in the Kane CLI evidence pack docs.
How to Set Up Kane CLI in Cursor
The Kane CLI skill installs into Claude Code, Codex CLI and Gemini CLI. Cursor takes its instructions from a link or an AGENTS.md file instead, and the rest of the loop is the same.
- Paste the guide into Cursor's chat - Ask: "Set up Kane CLI for this project using https://www.testmuai.com/kane-cli/agents.md". Cursor reads the guide and installs Kane CLI with
npm install -g @testmuai/kane-cli. - Sign in with your access key - Use your TestMu AI username and access key, from your account settings, as in the command below.
- Ask Cursor to check a flow - Cursor runs
kane-cli run "<objective>" --agentfrom its terminal and reports the pass or fail with the evidence link. - Share it with the team - Append the Kane CLI instructions to the AGENTS.md file at the root of your repository and commit it. Every teammate's Cursor agent then checks its changes with Kane CLI.
kane-cli login --username <username> --access-key <access key>
curl -fsSL https://www.testmuai.com/kane-cli-agent/AGENTS.md >> AGENTS.mdFull setup and examples: Cursor app testing with Kane CLI.
Sources
Each source below was fetched on November 17, 2026. Tools change quickly, so check the current docs before you rely on a flag or exit code.
- [1] Playwright, Playwright CLI getting started: playwright.dev/docs/getting-started-cli, fetched November 17, 2026.
- [2] Microsoft, Playwright MCP README: github.com/microsoft/playwright-mcp, fetched November 17, 2026.
- [3] TestSprite, CLI command reference: docs.testsprite.com/cli/reference/command-reference, fetched November 17, 2026.
- [4] TestSprite, coding agent integration: docs.testsprite.com/cli/core/agent-integration, fetched November 17, 2026.
- [5] TestSprite, exit codes and errors: docs.testsprite.com/cli/reference/exit-codes, fetched November 17, 2026.
- [6] TestSprite, testing local apps: docs.testsprite.com/cli/core/local-apps, fetched November 17, 2026.
- [7] TestSprite, installation: docs.testsprite.com/cli/getting-started/installation, fetched November 17, 2026.
- [8] Vitest, command line interface: vitest.dev/guide/cli, fetched November 17, 2026.
- [9] Vitest, reporters: vitest.dev/guide/reporters, fetched November 17, 2026.
- [10] Maestro, installing the Maestro CLI: docs.maestro.dev/maestro-cli/how-to-install-maestro-cli, fetched November 17, 2026.
- [11] Maestro, CLI commands and options: docs.maestro.dev/maestro-cli/maestro-cli-commands-and-options, fetched November 17, 2026.
- [12] Maestro, Maestro MCP: docs.maestro.dev/get-started/maestro-mcp, fetched November 17, 2026.
- [13] Maestro, CI/CD and cloud testing integration: maestro.dev/insights/maestro-ci-cd-cloud-testing-integration, fetched November 17, 2026.
Conclusion
Let Claude Code keep running Vitest, pytest or jest for unit tests. Add a browser or mobile tool for the layer above, and pick it by the three properties: a one-command install, a non-interactive run, and a verdict with exit codes Claude can branch on. Playwright CLI and Playwright MCP suit exploration, TestSprite CLI suits teams that want tests hosted on its platform, Maestro covers mobile flows, and Kane CLI gives Claude a pass or fail on a plain-English user flow.
For the Claude-specific setup, see Claude Code app testing, and read AI code testing for why a change that passed review still needs a run in the app.
Was this helpful?
Authors

Shantanu Wali
Author · 33 posts
Shantanu Wali is Vice President of Product Management at TestMu AI, where he owns several product lines across the testing platform, including the Real Device Cloud and the Digital Experience Testing Cloud. He has also contributed significantly to the development and scaling of KaneAI, TestMu AI's flagship GenAI-native testing agent that uses natural language to make software testing faster and more reliable in this AI era. He brings 7+ years of experience across software development and product management, starting as a backend developer at Infosys building solutions for Fortune 500 clients. Shantanu holds an MBA from IIM Calcutta and a B.Tech in Mechanical Engineering.
Mayank Bhola
Reviewer
Mayank Bhola is Co-Founder and Head of Products at TestMu AI, where he leads the entire product portfolio across KaneAI, Kane CLI, HyperExecute, SmartUI, the Real Device Cloud, Accessibility, and other software testing product lines. As an early Lead Architect he designed and built the company's flagship Tunnel technology from scratch, created the React-based automation platform, and architected the data-intensive pipelines and FAAS services that scale it. He brings more than 10 years of experience in software development and product engineering, with earlier roles as Head of Technology at Juggernaut Books and Senior Software Engineer at PressPlay TV and Zomato. Mayank holds a B.Tech in Computer Engineering from JIIT Noida.
FAQs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance
- Advanced access controls
- Advanced data retention rules
- Advanced Local Testing
- Premium Support options
- Early access to beta features
- Private Slack Channel
- Unlimited Manual Accessibility DevTools Tests



