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

# mo CLI

> Start, follow, and control Mo sessions from a terminal.

<Warning>
  Mo is in private beta. [Sign up](https://momentic.ai/mo) to get onboarded.
</Warning>

The `mo` CLI drives [Mo](/docs/mo/index), Momentic's autonomous QA agent, from a
terminal or a coding agent. Use it to start a session from a brief, read Mo's
output, answer questions, move files in and out of the hosted sandbox, and open
a tunnel so Mo can test an application on your machine. For a task-oriented
walkthrough, read [Use the Mo CLI](/docs/mo/cli).

## Install

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

The installer writes `mo` to `$HOME/.local/bin` on Linux and macOS (x86\_64 and
arm64). Run it again to update. Set `MO_VERSION` to pin a version or
`MO_INSTALL_DIR` to install somewhere else.

The package is also published as `@momentic/mo` and requires Node
`^22.12.0 || >=24.0.0`:

```bash theme={null}
npx @momentic/mo --help
```

## Commands

<CardGroup cols={2}>
  <Card title="login" icon="right-to-bracket" href="/docs/cli-reference/mo/commands/login">
    Sign in and save an API key, or sign out.
  </Card>

  <Card title="start" icon="play" href="/docs/cli-reference/mo/commands/start">
    Create a session from a brief.
  </Card>

  <Card title="send" icon="paper-plane" href="/docs/cli-reference/mo/commands/send">
    Send a message to a session.
  </Card>

  <Card title="read" icon="book-open" href="/docs/cli-reference/mo/commands/read">
    Read new output from a session.
  </Card>

  <Card title="status" icon="circle-info" href="/docs/cli-reference/mo/commands/status">
    Get a session snapshot with findings.
  </Card>

  <Card title="stop" icon="stop" href="/docs/cli-reference/mo/commands/stop">
    Stop the active turn.
  </Card>

  <Card title="archive" icon="box-archive" href="/docs/cli-reference/mo/commands/archive">
    Archive a session.
  </Card>

  <Card title="download" icon="download" href="/docs/cli-reference/mo/commands/download">
    Copy a file from the session sandbox.
  </Card>

  <Card title="upload" icon="upload" href="/docs/cli-reference/mo/commands/upload">
    Copy a local file into the session sandbox.
  </Card>

  <Card title="tunnel" icon="network-wired" href="/docs/cli-reference/mo/commands/tunnel">
    Let Mo reach applications available from this machine.
  </Card>

  <Card title="version" icon="code-branch" href="/docs/cli-reference/mo/commands/version">
    Print the installed version and check for updates.
  </Card>

  <Card title="licenses" icon="scale-balanced" href="/docs/cli-reference/mo/commands/licenses">
    Print licenses for bundled executables.
  </Card>
</CardGroup>

## Global flags

Every command that talks to the Momentic API accepts these flags. Per-command
pages document any other flags they accept.

<ParamField path="--api-key <key>" type="string">
  Momentic API key. Defaults to the value saved by `mo login` in
  `~/.momentic/auth.json`. Env: `MOMENTIC_API_KEY`.
</ParamField>

<ParamField path="--server <server>" type="string">
  Momentic server URL. Defaults to the server saved by `mo login`, then to
  `https://api.momentic.ai`. Env: `MOMENTIC_SERVER`.
</ParamField>

<ParamField path="--log-level <level>" type="string">
  One of `debug`, `info`, `warn`, or `error`. Defaults to `info`. Place it
  before the command name.
</ParamField>

## Output

Session commands print machine-readable output so a script or coding agent can
chain them: `start`, `send`, `status`, and `tunnel` print JSON, and `upload` and
`download` print a single path. `read` prints Mo's messages as plain text unless
you pass `--json`. Status lines such as `Mo is still working.` go to stderr.

## Session IDs

`mo start` prints a `sessionId`. Every later command takes that ID, either as a
positional argument (`mo read <session-id>`) or as `--session-id` (`mo send`,
`mo upload`, `mo download`). You can also copy the ID from the session URL in
the Momentic dashboard.

## Environment variables

| Variable                 | Purpose                                                            |
| ------------------------ | ------------------------------------------------------------------ |
| `MOMENTIC_API_KEY`       | Auth token. Overrides the key saved by `mo login`.                 |
| `MOMENTIC_SERVER`        | Override the API host.                                             |
| `MOMENTIC_ARTIFACTS_DIR` | Default directory for `mo download` when `--output` is not passed. |
| `MO_VERSION`             | Version for the installer script to install.                       |
| `MO_INSTALL_DIR`         | Directory for the installer script to write `mo` into.             |

## Notes

* The CLI shares `~/.momentic/auth.json` with `momentic` and `momentic-mobile`.
  Signing in with any one of them signs in all three.
* `read --timeout` and `send --wait` accept `0` or a duration such as `500ms`,
  `30s`, or `2m`, up to a maximum of `290s`.
* Every command exits `1` on an error and prints the reason to stderr. The
  waiting commands (`read`, `send --wait`, and `tunnel start`) exit `130` when
  you interrupt them with Ctrl+C.
