// For Claude Code · Codex CLI · Gemini CLI · Cursor · GitHub Copilot

Kane CLI for AI coding agents: test every change in a real browser

Your agent wrote it. Kane CLI checks it works. After each change, the agent runs one command: Kane CLI drives a real browser or device, checks the outcome you asked for, and hands back NDJSON and an exit code the agent can act on.

Install, sign in, then add the skill for Claude Code, Codex CLI or Gemini CLI

Cursor, GitHub Copilot or another agent? Paste this into it instead:

A coding agent verifies a coupon fix with Kane CLI
● Edited src/checkout/Coupon.tsx● Checking the change in a real browser $ kane-cli run "Go to http://localhost:3000/cart, apply coupon SAVE10,    then verify the cart shows the SAVE10 discount" --agent --headless {"type":"stream_start","cli_version":"0.9.0","surface":"run",…}{"step":2,"status":"running","remark":"Step 1",…}{"step":2,"status":"done","remark":"Opened the cart",…}{"step":3,"status":"done","remark":"Applied coupon SAVE10",…}{"step":4,"status":"done","remark":"The cart shows SAVE10, -$10.00",…}{"type":"run_end","status":"passed","reason":"Objective completed", "summary":"Coupon applied and the cart shows the SAVE10 discount", "test_url":"https://test-manager.lambdatest.com/…",…} $ echo $?0

// Agent setup: skill or AGENTS.md

Set up Kane CLI in your coding agent

Every agent runs the same kane-cli commands. Claude Code, Codex CLI and Gemini CLI get the Kane CLI skill. Cursor and GitHub Copilot read the AGENTS.md file, and any other agent that can run a terminal command can be pointed at it. Local browser runs need Node 18 or later and Google Chrome.

# once per machine$ npm install -g @testmuai/kane-cli$ kane-cli login$ npx @testmuai/kane-cli-skill # then just ask> fix the coupon bug and verify it in a browser

Kane CLI in Claude Code

The Kane CLI skill teaches Claude Code when to call kane-cli and how to read the result. On the first request it runs a ready check, runs kane-cli and shows a result card.

Check that your agent can run Kane CLI

Have your agent run kane-cli whoami, then this check. Exit code 0 means the agent can call kane-cli, you are signed in and Chrome is ready.

// Kane CLI test loop

Five steps a coding agent runs with Kane CLI

  1. 1 · change

    Edit the code and start the app

    The agent starts the app locally, or uses the preview URL from the deploy.

  2. 2 · run

    Run one plain-English objective

    kane-cli run "Go to <url> and <action>, then verify <expected result>" --agent --headless --timeout 180
  3. 3 · read

    Parse the run_end line and the exit code

    Check the exit code first, then read the last stdout line: the status, a summary, any stored values and a Test Manager link.

  4. 4 · fix

    Fix the code when the check fails

    The agent reads the failing step, fixes the app and reruns the same objective. It keeps the expected outcome and never weakens it to get a pass.

  5. 5 · keep

    Save a passing check as a test

    Run the objective with --name <flow> and Kane CLI writes a _test.md file and its output-<flow>/ recordings. Commit both and CI replays the test.

// Exit codes

Kane CLI exit codes and the agent's next step

A kane-cli run call always ends with an exit code. A run that starts also ends with a run_end event on stdout; a run refused before it starts exits 2, sometimes with no run_end. kane-cli testrun run uses 3 for cancelled only, and the assurance commands use 3 for paused.

Exit codes for kane-cli run
Exit codeMeaningWhat the agent does next
0PassedReport the summary and the test_url Test Manager link to the user. Done.
1FailedThe run went ahead and did not pass, or its upload failed. Read the failing step's remark first: a product bug, a stuck step or a vague objective all end here. Fix the cause and rerun the same command.
2Did not startNothing ran and no credits were used. Fix setup: sign-in (kane-cli whoami), Chrome, configuration or a missing start URL.
3Timeout or cancelledRaise --timeout or split the objective into shorter runs.

// Saved tests

Replay saved Kane CLI tests in seconds

With saved tests, cost tracks how often a test changes rather than how often it runs, because unchanged steps replay with no LLM cost.

Kane CLI authors every step on a test's first run

Kane CLI's AI works out each step through your app on the first run. Edit a step later and Kane CLI re-authors that step and every step after it.

Later runs replay a saved test's recording

A step replays from its recording, with no LLM cost, while it and every step before it are unchanged. A passing test replays in seconds, and that replay is what runs in CI.

Kane CLI re-authors a test from the failing step

When a replayed step no longer matches the page, Kane CLI re-authors from that step onward, with up to three attempts, then the whole test. --no-adaptive-heal makes a miss fail instead. Real-device runs do not heal.

Each run that starts leaves an evidence pack

The pack holds per-step screenshots, console and network logs, and failure records, and Kane CLI prints its path on stderr. kane-cli evidence serve <path-to-pack.evidence> serves it until stopped, so an agent starts it in the background and shares the viewer link.

// llms.txt and AGENTS.md

Kane CLI llms.txt and AGENTS.md for agents

This page has plain-text companions an agent can fetch directly: a short llms.txt map built around the loop, and the full AGENTS.md instructions.

Coding agents read the files they are pointed at, so install the skill or paste the one-line prompt first. The llms.txt file lists the loop, the rules for writing objectives and the how-to guides for an agent that fetches it.

www.testmuai.com/kane-cli/llms.txt # Kane CLI for coding agents > Kane CLI (`kane-cli`, by TestMu AI, formerly LambdaTest) is> the validation layer for AI coding agents. After you change> a web or mobile app, run `kane-cli run "<objective>" --agent`> ... exit code: 0 passed, 1 failed, 2 did not start,> 3 timeout or cancelled. Run it before you tell the user> the work is done. **Verify and fix loop for every code change** 1. Change the code, then start the app or get the preview URL.2. Run: `kane-cli run "Go to <url> and <action>, then verify   <expected result>" --agent --headless --timeout 180`.   Give your shell tool a longer timeout than `--timeout` ...3. Check the exit code, then read the `run_end` event   (the last stdout line)....

Coding agents and Kane CLI: common questions

How does a coding agent test what it just built with Kane CLI?

After an edit, the agent runs kane-cli run "Go to <url> and <action>, then verify <expected result>" --agent --headless --timeout 180. It checks the exit code, reads the run_end line, fixes the code if the run failed, and reruns the same command. Claude Code, Codex CLI and Gemini CLI learn this from the Kane CLI skill. Cursor, GitHub Copilot and other agents learn it from the AGENTS.md file.

Which file should a coding agent read: the Kane CLI skill or AGENTS.md?

For Claude Code, Codex CLI or Gemini CLI, install the skill from a terminal with npx @testmuai/kane-cli-skill (it does not install kane-cli itself). Other agents that can run a terminal command read the AGENTS.md file. Both teach the same commands, and one repository can use both.

How does a coding agent know whether a Kane CLI check passed?

From the exit code first, then the last stdout line. Exit 0 means passed, 1 failed, 2 did not start (sign-in, Chrome, configuration or a missing start URL) and 3 timeout or cancelled. The run_end event adds the summary, any stored values and the Test Manager link, and on a failure the failing step's remark says what went wrong.

What should a coding agent do when kane-cli exits with code 2?

Treat it as "did not start", not as a test failure: nothing ran and no credits were used. Check sign-in with kane-cli whoami, then Chrome, the configuration and the start URL. If the user is not signed in, run kane-cli login --oauth for them, or ask them to run kane-cli login in their own terminal. Never ask for an access key in chat.

Can a coding agent run several Kane CLI checks at once?

Yes. Split independent checks into separate kane-cli run calls and run them at the same time, as long as each objective opens its own page, signs in and checks its own result. For saved _test.md files, use one kane-cli testrun run --parallel <n> --agent --headless instead: isolated Chrome browsers for web tests, one summary and one exit code.

Can a coding agent test a mobile app with Kane CLI?

Yes, for app builds. --target android or --target ios with --app <build> runs on a real device in the TestMu AI cloud from any machine (kane-cli 0.9.0 or later, on a plan that includes real devices). --target emulator (Android) and --target simulator (iOS) run locally only on an Apple Silicon Mac with Android Studio or Xcode 16 or later; from other machines, run saved tests on the cloud grid with kane-cli testrun run --remote. Web pages run in desktop Chrome.

Why should a coding agent use Kane CLI instead of writing Playwright tests?

Scripts an agent writes depend on selectors, so they often need rewriting when the UI changes. A Kane CLI objective states the outcome instead. Saved as a _test.md file, its unchanged steps replay from the recording with no LLM cost, and when the page changes Kane CLI re-authors from the failing step.

What does Kane CLI cost?

Kane CLI is free to install. Its runs use KaneAI credits from your TestMu AI account, local runs included, and each run_end reports the credits_consumed. To start free, claim 10,000 credits, valid for 30 days. After that, KaneAI plans include monthly credits: Starter is $19 per agent per month, or $17 billed annually, with 2,000 credits a month and local authoring through Kane CLI. See KaneAI pricing.

What is the Kane CLI llms.txt file for?

It is a short map written for coding agents at www.testmuai.com/kane-cli/llms.txt: the loop, the rules for writing objectives, how to read run_end, and links to these how-to guides. Point an agent at it, or at the AGENTS.md file, and the agent has what it needs to call kane-cli.

Give your coding agent a real browser to check its work

Install Kane CLI, sign in, and add the skill or the AGENTS.md file. After that, each check your agent runs comes back with an exit code it can act on.

Start free