> ## 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.
> Mo is the AI QA engineer, a separate product from the YAML test framework: its npm package and CLI are `qa` (not `mo` — `npx mo` is a different project). Install with `npm install -g qa`, authenticate the same MOMENTIC_API_KEY way, install repo skills with `qa skills -y`, and start a session with `qa start "<brief>"` or `qa <url>`. Docs: https://momentic.ai/docs/mo.md.
> You cannot complete the browser sign-in yourself. Read the API key from the exact MOMENTIC_API_KEY environment variable (similarly named vars like BILT_MOMENTIC_API_KEY are ignored), 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 momentic skills --yes` (or `npx momentic-mobile skills --yes` for mobile).
> 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.

# Scripts and CI

> Start Mo sessions from scripts or CI with the CLI or HTTP API.

Start Mo after your deployment is ready and export the findings for your script
or CI job to review. Use a Momentic API key to authenticate.

## Start a session

Use the [`qa` CLI](/docs/mo/cli) from a script or continuous integration (CI) job
after your target is ready. Set `MOMENTIC_API_KEY` as a CI secret instead of
running `qa login`. Start a session with `qa start` and save its ID and URL. Use
`qa wait` to wait for completion or a question, then `qa report` to export
findings.

A successful wait means Mo finished testing. Check the report to see whether the
app met your criteria.

You can also start a web session over HTTP with a Momentic API key. This request
returns `sessionId` and `webUrl`:

```bash theme={null}
curl --fail-with-body https://api.momentic.ai/v1/mo/sessions \
  -H "Authorization: Bearer $MOMENTIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"Test checkout on https://preview.example.com. Do not submit payment or place an order."}'
```

## Start a PR session

Send the provider and PR reference to `/v1/mo/pr-sessions`. GitHub is the
supported PR provider. `previewUrl` is optional; supply it when your script or
coding agent knows which deployment to test:

```bash theme={null}
curl --fail-with-body https://api.momentic.ai/v1/mo/pr-sessions \
  -H "Authorization: Bearer $MOMENTIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Test the PR changes. Do not submit payment.",
    "pullRequest": {
      "provider": "github",
      "kind": "number",
      "owner": "acme",
      "repo": "shop",
      "number": 412
    },
    "previewUrl": "https://preview.example.com"
  }'
```

A selected environment needs no preview URL. Otherwise, discovery is best
effort: missing or ambiguous previews do not block startup. Mo can inspect the
PR or ask you for the target. Supply `previewUrl` when you know the deployment.

For recurring testing, configure a
[Mo schedule](/docs/mo/sessions#repeat-a-session-on-a-schedule) with a prompt and
environment. Each scheduled run starts a new session. Use an
[exported report](/docs/mo/reports#export-the-report) to read results from your
scripts.

See [Mo integrations](/docs/mo/integrations) for other connections.


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