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

> ## Agent Instructions
> The canonical docs host is https://momentic.ai/docs. Append .md to any page URL for clean Markdown. Fetch https://momentic.ai/docs/llms.txt for the page index and https://momentic.ai/docs/llms-full.txt for every page in one file.
> For an unattended setup, run `npx --yes @momentic/wizard@latest -y --platform web --editor-tools skills` (use `--platform ios` or `--platform android` for mobile). Never run an interactive command in a non-TTY shell.
> You cannot complete the browser sign-in yourself. Read the API key from the MOMENTIC_API_KEY environment variable, or ask the user to create one at https://app.momentic.ai/settings/api-keys and paste it back.
> Momentic's capability summary for agents is at https://momentic.ai/docs/skill.md. Install the skills with `npx skills@latest add momentic-ai/skills`.
> Tests are YAML files in the user's repository. Use only the step names listed at https://momentic.ai/docs/reference/commands.md and the file structure at https://momentic.ai/docs/core-concepts/file-format.md. Do not invent step names, config keys, or CLI flags.
> Web tests run on Chromium, iOS tests on simulators, and Android tests on emulators. Physical devices are not supported.

# Use the Mo CLI

> Install the mo CLI, start sessions, and test local or private targets through a tunnel.

Use the `mo` CLI to start and follow Mo sessions from a terminal. Use a tunnel
when the target runs on your machine or on a private network.

## Let a coding agent drive the CLI

If you work in Claude Code, Cursor, Codex, or Devin, install the `mo-qa` skill
and let the agent run the CLI for you:

```bash theme={null}
npx skills add https://github.com/momentic-ai/skills --skill mo-qa
```

Then invoke it with a slash prefix:

```text theme={null}
/mo-qa bug bash my new feature on <branch>
```

The skill installs and authenticates the CLI itself, asks you for the missing
parts of the brief, starts the session, and follows it. See
[install Mo skills](/docs/mo/skills). The rest of this page gives the commands the
skill runs.

## Install the CLI

The package is `@momentic/mo`. It requires Node `^22.12.0 || >=24.0.0`.

Install it with the published installer:

```bash theme={null}
curl -fsSL https://cli.momentic.ai/mo | sh
```

The installer writes `mo` to `$HOME/.local/bin`, and it supports Linux and macOS
on x86\_64 and arm64. Run it again to update. Set `MO_VERSION` for a version, or
`MO_INSTALL_DIR` for another directory.

## Authenticate

Sign in with a Momentic account:

```bash theme={null}
mo login
```

`mo login` saves an API key. You can use `MOMENTIC_API_KEY` or `--api-key`
instead.

## Start a session

Give `mo start` a brief in plain language:

```bash theme={null}
mo start "Test the checkout flow on https://preview.example.com. Sign in with the staging QA buyer. Do not submit payment."
```

The command prints JSON. Take the session ID from that output and use it with
the session commands below.

Use these options when you start a session:

| Option                      | Use                                                                      |
| --------------------------- | ------------------------------------------------------------------------ |
| `--tunnel <tunnel-id>`      | Connect through a Connector tunnel.                                      |
| `--repository <owner/name>` | Give Mo read-only context from a connected GitHub repository.            |
| `--max-concurrency <count>` | Set the maximum concurrent sub-agents, capped by the organization limit. |
| `--granularity <level>`     | Set how specific Mo explore-agent test discovery should be.              |

## Read and control a session

Use `mo read` to read new output since your last read:

```bash theme={null}
mo read <session-id>
```

Use `mo status` to return a session snapshot:

```bash theme={null}
mo status <session-id>
```

If Mo is working, `mo send` stops the active turn first. In-flight tool work is
interrupted, and Mo resumes from saved history with your message:

```bash theme={null}
mo send --session-id <session-id> "Also check the account settings flow."
```

Stop the active turn with `mo stop`:

```bash theme={null}
mo stop <session-id>
```

Archive a session when you no longer need it:

```bash theme={null}
mo archive <session-id>
```

## Move files

Use `mo upload` and `mo download` to move files between your local machine and
Mo's hosted sandbox. Both commands need a session, because the sandbox belongs
to that session:

```bash theme={null}
remote_path=$(mo upload --session-id <session-id> ./release-plan.md)
mo download --session-id <session-id> "$remote_path"
```

`mo upload` prints the sandbox path. Give Mo that path, because a local path has
no meaning inside the sandbox. `mo download` writes to `--output`, to
`MOMENTIC_ARTIFACTS_DIR`, or to `.momentic-artifacts`.

## Test a local build through a tunnel

A tunnel lets Mo reach an application on your machine or network that is not
publicly reachable. Start one for the exact local URL that you will put in the
brief:

```bash theme={null}
tunnel_json=$(mo tunnel start localhost:3000)
tunnel_id=$(jq -r .tunnelId <<<"$tunnel_json")
mo start "Test the checkout flow on http://localhost:3000. Sign in with the staging QA buyer. Do not submit payment." --tunnel "$tunnel_id"
```

Expose only the addresses the tested flow needs.
`mo tunnel start localhost:3000 api.internal:8080` opens several, `--foreground`
runs one until you interrupt it, and `mo tunnel list` lists the tunnels started
on this machine. Stop a tunnel after its last session with
`mo tunnel stop <tunnel-id>`, which revokes Mo's access.

## Command reference

| Command                                              | Action                                                      |
| ---------------------------------------------------- | ----------------------------------------------------------- |
| `mo login`                                           | Sign in with a Momentic account and save an API key.        |
| `mo logout`                                          | Sign out.                                                   |
| `mo start <message>`                                 | Start a session from a brief.                               |
| `mo send <message> --session-id <id>`                | Stop the active turn and resume the session with a message. |
| `mo read <session-id>`                               | Read new output since your last read.                       |
| `mo status <session-id>`                             | Return a session snapshot.                                  |
| `mo stop <session-id>`                               | Stop the active turn.                                       |
| `mo archive <session-id>`                            | Archive a session.                                          |
| `mo download <source> --session-id <id>`             | Move a file from the hosted sandbox to the local machine.   |
| `mo upload <source> [destination] --session-id <id>` | Move a file from the local machine to the hosted sandbox.   |
| `mo tunnel start <address...>`                       | Start a tunnel for one or more addresses.                   |
| `mo tunnel stop <tunnel-id>`                         | Stop a tunnel and revoke Mo's access.                       |
| `mo tunnel list`                                     | List tunnels started on this machine.                       |
| `mo licenses`                                        | Show the CLI licenses.                                      |
