> ## 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, first check whether Claude Code already has the Momentic plugin. With the plugin, run `npx --yes @momentic/wizard@latest -y --platform web --editor-tools none` and ignore any CLI skills-install suggestion in its output. Otherwise, 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, separate from repository YAML tests. With the Momentic plugin, use bundled mo-qa and hosted OAuth by default. Without the plugin, install only mo-qa with `npx -y qa skills --target <agent>`. Keep the requested interface. Otherwise, use hosted tools for web or mobile, including private web targets with an existing Connector. Run sessions that need a new tunnel with the qa CLI. If you can't run commands on the machine that reaches the target, ask the user to start the tunnel there, then use hosted tools unless you lack them or the CLI was requested. For a requested hosted session, use an online Connector and pass its name as access, not a CLI tunnel ID. If none is online, ask the user to run `npx -y qa tunnel start --name <name> <address>` on a machine that reaches the target and wait. Do not run login or tunnel commands for them. For a requested hosted session, report unavailable tools or authentication failures without starting a CLI session. For coding-agent bridge setup, ask the user to complete `npx -y qa login`, then add momentic-hosted as a stdio server running `npx -y qa mcp`. Plugin users must explicitly opt in and disable their hosted plugin entry before adding the bridge. Claude.ai/ChatGPT connectors keep https://mcp.momentic.ai with OAuth. After hosted testing completes, read the report and summarize findings and uncovered requirements. Call `momentic_mo_stop_session` only when the user asks or agrees. For CLI sessions, unless the user wants more testing, export the report, run `qa stop <id> --subagents` even if export fails, then summarize. The CLI is qa, not mo. Docs: https://momentic.ai/docs/mo/quickstart.md.
> Ask the user to complete browser sign-in. For local CLI tools, use the exact MOMENTIC_API_KEY environment variable. If it is absent, ask the user to create a key at https://app.momentic.ai/settings/api-keys and set it in the agent's environment. Never print the key or ask the user to paste it into chat.
> Momentic's capability summary for agents is at https://momentic.ai/docs/skill.md. Claude Code users with the Momentic plugin should use its bundled skills and skip CLI skills installation. Otherwise, run `npx momentic skills -y --target <agent>` or `npx momentic-mobile skills -y --target <agent>`. Both install momentic-test, momentic-maintain, and momentic-spec with web/mobile references. Use the running agent's target. The Momentic plugin also includes mo-qa; qa skills installs only mo-qa.
> 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.

# Upgrading to momentic-mobile v1

> What changed in momentic-mobile 1.0 and how to move your mobile project from a 0.x release.

momentic-mobile 1.0 drops Node.js 20 and changes how test videos are recorded.
This guide covers the breaking changes and how to upgrade.

> [!NOTE]
>
> This guide is for the mobile CLI (`momentic-mobile`). The web CLI (`momentic`)
> has its own [v3 upgrade guide](https://momentic.ai/docs/get-started/upgrade-to-v3.md). If your repo has
> both, upgrade each separately. When they share a configuration, follow the
> [simplified-format guide](https://momentic.ai/docs/get-started/migrate-to-simplified-format.md) to
> rewrite both platforms' files; one upgrade does not convert the other
> platform.

## Migrate with a coding agent

Paste this prompt into your coding agent. It runs the upgrade and checks the
result against an existing mobile test.

> [accordion] Copy the upgrade prompt
>
> ```text theme={null}
> Help me upgrade this project to momentic-mobile 1.x.
>
> ## What to do
>
> 1. Run `git status --short`. If there are uncommitted changes, stop and ask me.
> 2. Check `node -v`. Supported versions are 22.12.0 or later in the 22 line, and 24.0.0 or later. If the version is outside that range (for example 20 or 23), stop and tell me. Also update `.nvmrc`, the `engines` field in `package.json`, and the Node version in CI config if they pin an unsupported version.
> 3. Run `npx momentic-mobile@latest upgrade --dry-run` from the project root and show me the plan. Then run `npx momentic-mobile@latest upgrade --yes`.
> 4. Fix the breaking change. Search CI config, `package.json` scripts, and shell scripts for `--record-video`. It kept every recording, so replace it with `--video true` to keep that behavior. Ask me before you pick `--video false` or the new default `on-fail`.
> 5. Run `npx momentic-mobile skills --yes` so the coding agent skills match the new CLI.
> 6. Run one existing test with `npx momentic-mobile run <a test name>` to confirm it passes.
>
> ## Critical rules
>
> - Follow the steps in order.
> - Show me the diff before you commit.
> - Do not change test behavior. The upgrade updates the CLI, the file format, and the recommended config defaults. Do not edit test steps by hand.
>
> ## When done, report
>
> - What changed in `momentic.config.yaml`.
> - Which test files were rewritten.
> - Anything you could not fix.
> ```

## 1. Use a supported Node.js version

momentic-mobile 1.0 requires Node.js 22.12.0 or later in the 22.x line, or
24.0.0 or later. Node.js 20 and 23 are unsupported. Check your version:

```bash theme={null}
node --version
```

Update the Node version in your CI images and any `.nvmrc` / `engines` field
before upgrading.

## 2. Run the upgrade

Save your current configuration, tests, `package.json`, and lockfile before
upgrading. Check `git status --short` and keep unrelated changes separate so you
can recover from a partial rewrite. If the upgrade changes the file format,
coordinate with collaborators and have them rebase after it lands.

From your mobile project root, preview the changes first:

```bash theme={null}
npx momentic-mobile@latest upgrade --dry-run
```

The preview needs a valid saved login or `MOMENTIC_API_KEY`. Check it with
`npx momentic-mobile@latest whoami`; see
[authentication](https://momentic.ai/docs/cli-reference/momentic-mobile/commands/login.md) if it fails.
`--dry-run` skips the package installation, project file writes, and snapshot
uploads.

Review the preview, then apply the upgrade:

```bash theme={null}
npx momentic-mobile@latest upgrade
```

Invoke `momentic-mobile@latest` so the rewrite uses the current serializer.
Updating the package during a command does not replace that command's running
process. Use `--config <path>` if project discovery finds more than one
configuration.

The command installs the CLI as a development dependency and updates the project
configuration. For a legacy-format project, it rewrites mobile tests and modules
and sets `fileFormat: v2`. It also updates `ai.agentConfig`: entries that match
the recommendation or start with it followed by `.` stay unchanged. Other
versions, including older exact pins, change to the recommendation. It sets
`ai.useMemory: true` and `ai.failureRecovery: true`, even if you previously
disabled them. Review those changes before running tests.

When the config already says `fileFormat: v2`, upgrade skips the YAML rewrite.
If legacy files remain, first recover from any partial migration, then use
[`momentic-mobile migrate simplified-format`](https://momentic.ai/docs/cli-reference/momentic-mobile/commands/migrate).

If the format and AI settings are already current, project files stay unchanged;
the package installation can still update the CLI. See
[`momentic-mobile upgrade`](https://momentic.ai/docs/cli-reference/momentic-mobile/commands/upgrade).

> [!WARNING]
>
> The upgrade is not atomic. It installs the CLI before rewriting project files.
> If serialization fails, some files may already have changed. Revert the
> changes made by that upgrade attempt, fix the reported error, and rerun.
> Preserve unrelated work; reinstall the previous dependency version if you need
> to restore the pre-upgrade installation.

## Breaking changes

**`--record-video` flag removed.** Use `--video` instead (`--video true` to keep
every recording, `--video false` to disable). Recording now defaults to
`on-fail`: a video is captured for every run but kept only when the test fails.
An explicit `recordVideo` setting or `--video` flag overrides this default.

## Other changes

These need no action:

* AI action steps default to the V3 agent. Existing steps continue to run
  unchanged.
* `momentic-mobile init` writes recommended AI agent versions for new projects.
  It does not rewrite an existing configuration. Current agent defaults can use
  a major version; pin an exact supported sub-version when you need that
  revision to stay fixed. See [AI configuration](https://momentic.ai/docs/configuration/ai.md).

## 3. Validate and update CI

Validate the rewritten files, then run an existing test with the same app build,
device settings, environment, and test data as before upgrading. Replace the
example path with your test:

```bash theme={null}
npx momentic-mobile lint
npx momentic-mobile list
npx momentic-mobile run mobile-tests/login.test.yaml --upload-results
```

Inspect the run result, recovery activity, and failure classifications before
changing the test. Then run the affected suite and confirm the expected tests
and parameterized cases actually ran. Account for disabled or skipped tests and
quarantine; exit code `0` alone does not prove equivalent behavior.

Once the checks pass, review and commit `momentic.config.yaml`, rewritten tests
and modules, `package.json`, and the lockfile together. Update explicit Momentic
Mobile version pins in CI, then install from the committed lockfile and invoke
the project CLI. Mobile tests do not need a browser reinstallation; retain the
[iOS](https://momentic.ai/docs/platforms/ios/simulators.md) or [Android](https://momentic.ai/docs/platforms/android/app-setup.md)
toolchain required by your tests.

## Related

* [Simplified format](https://momentic.ai/docs/get-started/migrate-to-simplified-format.md)
* [`momentic-mobile upgrade`](https://momentic.ai/docs/cli-reference/momentic-mobile/commands/upgrade)
* [`momentic-mobile run`](https://momentic.ai/docs/cli-reference/momentic-mobile/commands/run)


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