> ## Documentation Index
> Fetch the complete documentation index at: https://www.testmuai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Use Kane CLI in AI Coding Agents

> Install the Kane CLI skill for Claude Code, Codex CLI, or Gemini CLI to enable browser automation directly from your AI coding agent.

## What Is Kane CLI?

Kane CLI is the  command-line tool for end-to-end testing, browser automation, and native mobile-app testing.

* **Run a user journey.** Describe it in plain English. Kane CLI runs it in a real browser, on an Android emulator, on an iOS simulator, or on a real Android or iOS device in the  cloud.
* **Get a verdict you can trust.** Every run returns a pass or fail backed by execution evidence.
* **Design a test suite.** The assurance commands design requirement-linked, coverage-accounted test suites from the requirements in a PRD or specification.

Your coding agent can then execute, debug, and report results without writing test cases by hand.

## Use Kane CLI From Your Coding Agent

You can use Kane CLI by talking to your AI coding agent (Claude Code, Codex CLI, Gemini CLI, and others) instead of typing commands yourself. A Kane CLI **skill** makes this work. It is a folder of markdown instructions that teaches the agent how to use `kane-cli`: when to call it, how to build the command, how to read the NDJSON output (one JSON event per line), how to present the result, and what to do when a run fails.

Install the skill once. From then on, whenever you ask for something that needs a browser, your agent checks that everything is ready, runs your request in a real browser, and shows you the result.

Skills build on [Agent Mode](https://www.testmuai.com/docs/kane-cli-agent-mode.md) (the `--agent` flag). The skill tells the agent to always pass `--agent`, read the NDJSON stream, and report a structured result back to you.

This page also covers what to expect on your first run, what gets saved on your machine, and how to watch runs live.

> [!NOTE]
>
> The skill is a folder of plain markdown files plus the ready-check scripts. You can review and customize the installed copy, but running the installer again replaces the folder, and your edits with it.

***

## Install

The quickest way to get started is one command. It installs the skill globally for Claude Code, Codex CLI, and Gemini CLI:

```bash theme={null}
npx @testmuai/kane-cli-skill
```

The installer copies the skill folder to `~/.claude/skills/kane-cli/` (Claude Code), `~/.agents/skills/kane-cli/` (Codex CLI), and `~/.gemini/skills/kane-cli/` (Gemini CLI). Running it again replaces those folders with the current version, and `npx @testmuai/kane-cli-skill uninstall` removes them. The installer also creates the folder that holds your agent preferences. You need Kane CLI itself installed too (see [Installation](https://www.testmuai.com/docs/kane-cli-installation.md)).

If Kane CLI is already installed, `kane-cli install skill` installs the skill too: it downloads the newest skill version that is compatible with your Kane CLI release into the same three folders. Restart your agent afterwards to load it.

Next, open your agent in a project and ask for something that needs a browser:

```text theme={null}
check that the home page loads on my app
```

> [!NOTE]
>
> The installer writes skill folders for Claude Code, Codex CLI, and Gemini CLI only. Cursor and GitHub Copilot read `AGENTS.md`, so from your repo root, run `curl -fsSL https://www.testmuai.com/kane-cli-agent/AGENTS.md >> AGENTS.md` once. Kiro uses the Kane CLI Power. See [AI Coding Agents](https://www.testmuai.com/docs/kane-cli-with-ai-coding-agents.md).

To install the skill by hand for a single agent, copy the skill folder from the Kane CLI repository. Clone the repository once:

```bash theme={null}
git clone --depth 1 https://github.com/LambdaTest/kane-cli.git /tmp/kane-cli
```

Then copy the whole `skill-installer/skills/` folder into the agent's skills directory, as shown for each agent below. `SKILL.md` alone is not enough: it reads the files in `references/` and runs the ready-check script in `scripts/`.

***

## Install by Agent

> [tab] Claude Code
>
> The Kane CLI skill for Claude Code is a folder in your skills directory: `SKILL.md` plus its `references/` and `scripts/` folders. The installer writes it to `~/.claude/skills/kane-cli/`.
>
> **Global install** (available in all projects):
>
> ```bash theme={null}
> mkdir -p ~/.claude/skills/kane-cli
> cp -R /tmp/kane-cli/skill-installer/skills/. ~/.claude/skills/kane-cli/
> ```
>
> **Project-level install** (available only in this project):
>
> ```bash theme={null}
> mkdir -p .claude/skills/kane-cli
> cp -R /tmp/kane-cli/skill-installer/skills/. .claude/skills/kane-cli/
> ```
>
> If Claude Code is already running, restart it to load the skill. Then ask for any browser task, or invoke the skill with `/kane-cli`.
>
> **What Claude can do with this skill:**
>
> * Recognize when your request involves a browser and invoke `kane-cli` automatically
> * Build properly structured `kane-cli run --agent` commands
> * Parse the NDJSON output and present structured results with step counts, duration, extracted values, and assertion results
> * Inspect failure logs and screenshots to diagnose issues
> * Run multiple browser tests in parallel using sub-agents
> * Suggest bug reports for agent failures, linked to the GitHub repo
>
> **Example prompts:**
>
> ```
> "Can you verify the checkout flow on staging.myapp.com works?"
> "Check if our login form shows the right error for wrong passwords"
> "Search for 'laptops' on Amazon and store the top 3 prices"
> ```

> [tab] Codex CLI
>
> The Kane CLI skill for Codex CLI is a folder in `~/.agents/skills/`, the skills directory Codex CLI reads. Inside a repository that has its own `.agents/skills/` folder, the project copy wins. The installer writes the skill to `~/.agents/skills/kane-cli/`.
>
> **Global install** (available in all projects):
>
> ```bash theme={null}
> mkdir -p ~/.agents/skills/kane-cli
> cp -R /tmp/kane-cli/skill-installer/skills/. ~/.agents/skills/kane-cli/
> ```
>
> **Project-level install**:
>
> ```bash theme={null}
> mkdir -p .agents/skills/kane-cli
> cp -R /tmp/kane-cli/skill-installer/skills/. .agents/skills/kane-cli/
> ```
>
> Restart Codex CLI to load the skill. Then ask for any browser task, or invoke the skill with `$kane-cli`.
>
> > [!NOTE]
> >
> > Codex CLI runs commands in a sandbox that blocks network access and writes outside the workspace. Kane CLI needs both, so expect to approve each `kane-cli` command, or relax the sandbox for the session.
>
> **What Codex can do with this skill:**
>
> * Invoke `kane-cli run --agent` for browser tasks
> * Read the NDJSON stream and present the result
> * Run independent browser tests in parallel
> * Diagnose failures from the run's evidence pack
>
> **Example prompts:**
>
> ```
> "Verify the staging site checkout flow works"
> "Run the login test and tell me what happened"
> ```

> [tab] Gemini CLI
>
> The Kane CLI skill for Gemini CLI is a folder in your Gemini skills directory. The installer writes it to `~/.gemini/skills/kane-cli/`.
>
> **Global install** (available in all projects):
>
> ```bash theme={null}
> mkdir -p ~/.gemini/skills/kane-cli
> cp -R /tmp/kane-cli/skill-installer/skills/. ~/.gemini/skills/kane-cli/
> ```
>
> **Project-level install**:
>
> ```bash theme={null}
> mkdir -p .gemini/skills/kane-cli
> cp -R /tmp/kane-cli/skill-installer/skills/. .gemini/skills/kane-cli/
> ```
>
> Restart Gemini CLI to load the skill, then run `/skills list` to confirm it is there.
>
> **What Gemini can do with this skill:**
>
> * Identify browser automation requests and invoke `kane-cli run --agent`
> * Parse NDJSON events and surface the final result
> * Run tests in parallel using shell subprocesses
> * Diagnose failures from the run's evidence pack
>
> **Example prompts:**
>
> ```
> "Test that the homepage loads correctly on staging"
> "Verify the registration flow works end to end"
> ```

***

## What Happens on Your First Run

1. **A ready check.** The agent runs one short script and shows a card with who is signed in, credits left, whether Chrome was found, your app if it is already running locally, and where results will be saved. If something is missing, such as a sign-in, the card tells you and offers the fix. The agent can open the sign-in page for you. It never asks you to paste an access key into the chat.
2. **The run starts right away.** The agent does not ask you anything first. The browser opens in a visible window so you can watch, unless your machine has no display.
3. **A short tour while you wait.** A run takes from 30 seconds to a few minutes. The agent uses that time to explain what Kane CLI does: one-off runs, saved tests that replay in seconds, requirement-driven assurance, where runs land in Test Manager, and what an evidence pack is.
4. **A result card.** You see pass or fail, what happened, credits used, a link to your evidence pack, a link to the test case in Test Manager, and two things the agent can do next.
5. **Three quick choices, asked once.** After your first result, the agent asks whether to keep showing the browser, whether results are going to the right place, and whether you are doing one-off checks or building a saved suite. It does not ask again.

In later sessions, the ready check is a single line and the tour is skipped. Say "kane tour" at any time to see the tour again.

***

## Your Preferences

The agent saves your answers in one small file next to Kane CLI's own settings:

```text theme={null}
~/.testmuai/kaneai/agent-config/config.json
```

| Preference | Values | Effect |
| - | - | - |
| Watch mode | `visible` · `quiet` · `results-only` | Show the browser window, run in the background, or run in the background and show only the result |
| Purpose | `one-off` · `suite` · `ask` | Whether the agent offers to keep passing runs as saved tests |

The same file applies to all your agents and projects. To change a preference, tell your agent "kane preferences", or set it yourself:

```bash theme={null}
npx @testmuai/kane-cli-skill prefs --watch quiet --purpose suite
```

You can safely delete the file. The agent then uses sensible defaults and treats your next session as a first run.

### Where Results Are Saved

Every run is saved as a test case in a Test Manager project and folder (see [Test Manager Integration](https://www.testmuai.com/docs/kane-cli-tms-integration.md)). The ready check always shows which project and folder. To use a different one, tell your agent "change project". The agent lists your projects, lets you pick one or create a new one, and saves your choice.

This setting belongs to Kane CLI, not to the agent. A change applies to **every later Kane CLI session for your sign-in**: every project folder, every agent, and the terminal. Tests you already ran stay in their original project.

***

## Watch Runs Live (Claude Code)

In Claude Code you can turn on a live status strip. While a run is in progress, one line in your status bar shows the current step:

```text theme={null}
◆ kane run ▸ step 7 · clicking "Add to cart"          0:42
◆ kane test ▸ step 3 "Search for headphones" · replaying   0:12
◆ kane suite ▸ 5 of 12 · 4 ✓ 1 ✗ · now: login_test.md      2:10
◆ kane run ✓ passed · 12 steps · 1:54 · 58 credits
```

The strip is off until you turn it on. Claude Code offers it once, with a recommendation to say yes, after your first result in Claude Code. It does this even if your first Kane CLI run happened in another agent. The installer asks the same question when you run it by hand in a terminal. You can also manage the strip yourself:

```bash theme={null}
npx @testmuai/kane-cli-skill strip enable      # turn it on
npx @testmuai/kane-cli-skill strip status      # check it
npx @testmuai/kane-cli-skill strip disable     # turn it off
```

What to know:

* **It keeps your existing status line.** Your status line prints first, unchanged. The kane line appears under it only while a run is live and for five minutes afterwards.
* **Only the session that started the run shows it.** If you have several Claude Code sessions open, even in the same project, the others are unchanged. On Windows, every session open in the run's project shows the strip.
* **Turning it on edits `~/.claude/settings.json`.** A backup is kept next to the file, and `strip disable` restores your original status line exactly.
* **Requires Kane CLI 0.8.17 or later and Node 18 or later.**
* **It stays on your machine.** The strip reads two things Kane CLI writes locally during a run: a small pointer file for each live run, and that run's event log. It makes no network calls.
* **It never shows what was typed.** A typing step appears as "typing in" plus the field's name.
* **It appears shortly after launch.** The strip picks up a run roughly 10 to 30 seconds after it starts, once the browser is up and Kane CLI has created the session. While a step is still in progress, the line shows the last finished action, marked `last:`.

Other agents do not have a scriptable status bar, so the strip is available only in Claude Code. Everything else on this page works the same in every agent.

> [!TIP]
>
> For more than one line, add the [Kane CLI plugin for Claude Code](https://www.testmuai.com/docs/kane-cli-claude-code-plugin.md): a band above the prompt for every run, a result card in the chat with the evidence one click away, and a pane for steps, assurance and history.

***

## Signing In From an Agent

If you are not signed in, the ready check tells you and offers the fix. The agent can open the sign-in page for you, and it never asks you to paste an access key into the chat.

If no browser can open, for example on a CI runner, in a container, or in a sandboxed builder, sign in with Basic Auth from your own terminal or pipeline instead:

```bash theme={null}
kane-cli login \
  --username "YOUR_LT_USERNAME" \
  --access-key "YOUR_LT_ACCESS_KEY"
```

Get credentials from the  [dashboard](https://accounts.lambdatest.com/dashboard) > **Credentials**. Verify with `kane-cli whoami`. See [Authentication](https://www.testmuai.com/docs/kane-cli-authentication.md) for every sign-in method.

***

## How Skills Work

When you ask your AI agent to test something on the web, the skill:

1. Runs the ready check: one short script that confirms `kane-cli` is installed and shows who is signed in, credits left, Chrome, and where results will be saved.
2. Builds a `kane-cli run --agent` command from your request. The browser opens in a visible window unless your watch mode preference says otherwise or there is no display. In those cases the command adds `--headless`.
3. Waits for the run to exit, then reads the exit code and the NDJSON stream. For a `run`, the last event, `run_end`, carries the final result.
4. Presents a structured result: status, steps, duration, extracted values, and assertion results.
5. If the run failed, opens the run's evidence pack (screenshots, console and network logs, failure records) to find the cause.
6. Rates the run, and suggests a bug report when a failure looks like a low-quality agent run.

***

## What Leaves Your Machine

Kane CLI uploads the same data whether you run it yourself or through an agent. By default, each run is saved to your  account as a Test Manager test case, with its screenshots and run details (see [Test Manager Integration](https://www.testmuai.com/docs/kane-cli-tms-integration.md)). Evidence packs are sealed on your machine, and the evidence viewer reads them from your machine (see [Evidence Packs](https://www.testmuai.com/docs/kane-cli-evidence.md)). The agent preferences file and the status strip stay on your machine.

***

## Running With No Person Present

In CI, or with a cloud agent that cannot ask you anything, the agent skips the tour and the questions, runs headless with default settings, and does not write the preferences file. It still stops and reports clearly if Kane CLI is not installed, you are not signed in, or you are out of credits. For pipelines, calling Kane CLI directly is usually simpler. See [CI/CD Integration](https://www.testmuai.com/docs/kane-cli-cicd.md).

***

## Skill File Locations

| Agent | Global | Project-level |
| - | - | - |
| Claude Code | `~/.claude/skills/kane-cli/` | `.claude/skills/kane-cli/` |
| Codex CLI | `~/.agents/skills/kane-cli/` | `.agents/skills/kane-cli/` |
| Gemini CLI | `~/.gemini/skills/kane-cli/` | `.gemini/skills/kane-cli/` |

Each folder holds `SKILL.md`, `references/`, and `scripts/`, plus a `VERSION` file when the installer wrote it. The installer writes the global folders only. OpenCode loads skills from `~/.claude/skills/` and `~/.agents/skills/`, so the same install covers it.

Source files: [github.com/LambdaTest/kane-cli/tree/main/skill-installer/skills](https://github.com/LambdaTest/kane-cli/tree/main/skill-installer/skills)

***

## Next Steps

* [Quick Start](https://www.testmuai.com/docs/kane-cli-quickstart.md): the same first run, typed by hand.
* [Modes of Operation](https://www.testmuai.com/docs/kane-cli-modes.md): objectives, flags and what a run does.
* [Test.md](https://www.testmuai.com/docs/kane-cli-testmd.md): keep a flow as a saved test that replays in seconds.
* [Evidence Packs](https://www.testmuai.com/docs/kane-cli-evidence.md): what every run captures and how to view it.
* [AI Coding Agents](https://www.testmuai.com/docs/kane-cli-with-ai-coding-agents.md): walkthroughs and patterns for using Kane CLI from any coding agent.

## Terminal First Testing With Kane CLI

Natural language browser & mobile app tests right from terminal.

Book a Demo

![Kane CLI terminal](https://assets.testmu.ai/resources/images/Terminal-KaneCLI.png)

×

Schedule Your Personal Demo

<form>
  Select Product

  Schedule Demo
</form>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.