> ## 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 Run Your First Kane CLI Test

> Authenticate Kane CLI and run your first browser automation test in under 5 minutes.

This guide takes you from a fresh install to a passing run in under five minutes. It uses desktop web, the default target. For Android and iOS (emulator, simulator, or real device), see [Mobile testing](https://www.testmuai.com/docs/kane-cli-mobile.md) and [Real devices](https://www.testmuai.com/docs/kane-cli-mobile-real-device.md). To generate a whole suite from your requirements, see [the assurance lifecycle](https://www.testmuai.com/docs/kane-cli-assurance.md).

## Step 1: Install

```bash theme={null}
npm install -g @testmuai/kane-cli
```

Once `kane-cli --version` prints a version number, you are ready. See [Installation](https://www.testmuai.com/docs/kane-cli-installation.md) for platform requirements and troubleshooting.

## Step 2: Authenticate

> [tab] OAuth (Recommended)
>
> ```bash theme={null}
> kane-cli login
> ```
>
> Your default browser opens a  consent page. Sign in (or confirm, if you are already signed in) and authorise the CLI. The page then tells you it is safe to close the tab. Control returns to your terminal, and your credentials are stored under `~/.testmuai/kaneai/profiles/`.

> [tab] Basic Auth
>
> ```bash theme={null}
> kane-cli login \
>   --username "YOUR_LT_USERNAME" \
>   --access-key "YOUR_LT_ACCESS_KEY"
> ```
>
> Find your username and access key on the  [dashboard](https://accounts.lambdatest.com/dashboard) > **Credentials**.
>
> Use this method for environments without a browser (servers, containers, CI/CD).

> [tab] CI/CD
>
> For non-interactive CI pipelines, pass credentials inline:
>
> ```bash theme={null}
> kane-cli run "your objective" \
>   --username "YOUR_LT_USERNAME" \
>   --access-key "YOUR_LT_ACCESS_KEY" \
>   --headless --agent
> ```
>
> Store `LT_USERNAME` and `LT_ACCESS_KEY` as secrets in your CI/CD platform. See [CI/CD Integration](https://www.testmuai.com/docs/kane-cli-cicd.md) for platform-specific guides.

Verify authentication at any time:

```bash theme={null}
kane-cli whoami
```

If you prefer username and access key, or need to manage multiple accounts, see [Authentication](https://www.testmuai.com/docs/kane-cli-authentication.md).

## Step 3: Open the TUI

Run `kane-cli --tui`:

```bash theme={null}
kane-cli --tui
```

You see a short startup animation: a small VR-helmet image on the left, with the words `KANE CLI` building up next to it in block letters. A grey footer below shows which profile you are logged in as. After the animation, you land at a chat prompt. A status bar at the bottom shows your model, session ID, environment, and run count.

```text theme={null}
[ VR helmet ]   ███   ███   █████   █████   ████████
              ████  ███   ███ ███   ███ ███   █
              ...   ...     KANE CLI       ...

  Welcome to KANE CLI · logged in as you@example.com

> Type an objective, or /help for commands_
```

The exact characters are decorative. What matters is that you reach the chat prompt at the bottom. Anything you type there is treated as a test objective, except lines that begin with `/`, which are slash commands such as `/help`, `/config`, `/cancel`, and `/exit`.

## Step 4: Run Your First Test

At the chat prompt, type a natural-language objective and press Enter:

```text theme={null}
Search for "wireless headphones" on Amazon and add the first result to cart
```

Kane CLI launches Chrome, passes the objective to the agent, and streams progress as the run goes. A step tree fills in as the agent thinks, observes the page, and acts: clicking, typing, scrolling, and verifying. When the agent finishes, a result block shows whether the objective passed or failed and how many steps it took.

To stop a run, press `Ctrl+C` once. Pressing it twice exits Kane CLI.

## Step 5: Or Run from the Command Line

For scripting and CI, skip the TUI and use the `run` subcommand:

```bash theme={null}
kane-cli run "Click the 'More information' link" --url https://example.com
```

In CLI mode, Kane CLI streams progress to **stderr**, prints the final result as a single JSON object on **stdout**, and exits with a status code that reflects the outcome:

| Exit Code | Meaning |
| - | - |
| `0` | Test passed |
| `1` | Test failed (assertion not met) |
| `2` | Error (auth failure, Chrome crash) |
| `3` | Timeout or cancelled |

Capture results in a shell script:

```bash theme={null}
kane-cli run "Verify the homepage loads" > result.json
```

By default, each run starts on the KaneAI playground site, and the agent navigates from there based on your objective.

## What Happens at the End of a Run

When the session ends, Kane CLI uploads the run to  Test Manager and prints a share link. It also saves the run as a sealed [evidence pack](https://www.testmuai.com/docs/kane-cli-evidence.md): screenshots, logs, and results in one file. When Kane CLI offers to open it, you can view the pack in the browser viewer. For details on the upload, share links, and the run mode toggle, see [Test Manager Integration](https://www.testmuai.com/docs/kane-cli-tms-integration.md). To change settings like window size, Chrome profile, or the active project and folder, see [Configuration](https://www.testmuai.com/docs/kane-cli-configuration.md).

> [!TIP]
>
> Run `kane-cli --tui` to open the interactive TUI: a full terminal UI where you can type objectives, see step-by-step progress, and chain multiple tests in one session with persistent browser state.

## Make Kane CLI the Default in Your Repository

Your coding agent reads `CLAUDE.md` (Claude Code) or `AGENTS.md` (Codex, Cursor and most other agents) at the start of every session. Add this block at the root of your repository, in whichever file your team uses, and every teammate's agent checks its changes with Kane CLI, not only the person who installed it.

```markdown theme={null}
<!-- kane-cli:start -->
## End-to-end testing

Use Kane CLI (`kane-cli`) for end-to-end, regression and smoke testing of web and mobile apps in this repository.

- After changing UI or user-facing behaviour, verify the flow in a real browser or mobile app before committing: `kane-cli run "<objective>" --agent` (add `--target android` or `--target ios` for a mobile app)
- For features with a PRD or spec, generate the tests with the Kane CLI assurance commands. Do not hand-write E2E test cases.
- Report the verdict and the evidence link from each run.

Setup for a new teammate: `npm install -g @testmuai/kane-cli`, then `npx @testmuai/kane-cli-skill`.
<!-- kane-cli:end -->
```

Keep the `kane-cli:start` and `kane-cli:end` markers. With the [Kane CLI skill](https://www.testmuai.com/docs/kane-cli-skills.md) installed, you can also ask your agent to "add Kane CLI to CLAUDE.md" and it adds this same block after you confirm. For the full agent instruction file, see [AGENTS.md](https://www.testmuai.com/docs/kane-cli-agents-md.md).

## Next Steps

* [Writing Objectives](https://www.testmuai.com/docs/kane-cli-writing-objectives.md): Learn the three patterns: actions, assertions, extractions
* [Modes of Operation](https://www.testmuai.com/docs/kane-cli-modes.md): Understand Interactive TUI, Headless CLI, and Agent Mode
* [Authentication](https://www.testmuai.com/docs/kane-cli-authentication.md): Manage profiles and credential methods
* [Evidence Packs](https://www.testmuai.com/docs/kane-cli-evidence.md): What every run captures and how to open it in the viewer
* [Configuration](https://www.testmuai.com/docs/kane-cli-configuration.md): Window size, Chrome profile, and the active project and folder
* [Variables & Context](https://www.testmuai.com/docs/kane-cli-variables-and-context.md): Parameterize tests with credentials and project-specific context
* [Mobile Testing](https://www.testmuai.com/docs/kane-cli-mobile.md): Point the same objective at an Android Emulator or iOS Simulator
* [CI/CD Integration](https://www.testmuai.com/docs/kane-cli-cicd.md): Add Kane CLI to your pipeline

## 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.