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

# Other CI providers

> Run Momentic tests from CircleCI, Jenkins, Travis CI, Buildkite, or Azure DevOps, with sharding and secrets.

Use these pipelines to install dependencies and run `npx momentic run`. Set
`MOMENTIC_API_KEY` in your provider's secret store. Sharding examples are
included for CircleCI, Buildkite, and Azure DevOps. For GitHub Actions and
GitLab CI, see [GitHub Actions](https://momentic.ai/docs/running-tests/ci/github-actions.md) and
[GitLab CI](https://momentic.ai/docs/running-tests/ci/gitlab-ci.md). More configs live in
[momentic-ai/examples](https://github.com/momentic-ai/examples).

Every example assumes `momentic` is a dev dependency in the root `package.json`:

```json package.json theme={null}
{
  "devDependencies": {
    "momentic": "latest"
  }
}
```

## CircleCI

For [CircleCI](https://circleci.com/), create `.circleci/config.yml` in your
repository:

```yaml config.yml theme={null}
version: 2.1
orbs:
  node: circleci/node@5.0.2
workflows:
  test:
    jobs:
      - test
jobs:
  test:
    docker:
      - image: cimg/node:22.12
    steps:
      - checkout
      - node/install-packages

      - run:
          name: Install browsers
          command: npx momentic install-browsers --all

      - run:
          name: Run Momentic tests
          command: npx momentic run
          when: always

      - run:
          name: Upload results
          command: npx momentic results upload test-results
          when: always
```

### CircleCI authentication

Set the `MOMENTIC_API_KEY` environment variable in your CircleCI project
settings.

1. Create an API key in the
   [Momentic dashboard](https://app.momentic.ai/settings/api-keys).

Copy the value. You add it as a CI secret in the next step.

2. Go to your CircleCI project settings and click the **Environment Variables**
   tab. Create a new secret called `MOMENTIC_API_KEY` and enter your API key.

3. CircleCI automatically loads environment variables stored in project settings
   into the CI environment. The CI file needs no changes.

### CircleCI sharding

To shard your tests, pass the `--shard-index` and `--shard-count` options to the
`momentic run` command. The `--shard-index` is the index of the current shard
(starting from 1), and `--shard-count` is the total number of shards.

To collect test results inside a single run group in the Momentic dashboard, add
a separate step after all tests complete to merge and upload results.

```yaml config.yml theme={null}
version: 2.1
orbs:
  node: circleci/node@5.0.2

jobs:
  run-tests:
    parallelism: 2
    docker:
      - image: cimg/node:22.12
    steps:
      - checkout
      - node/install-packages

      - run:
          name: Install browsers
          command: npx momentic install-browsers --all

      - run:
          name: Run tests
          command: |
            mkdir -p test-results/shard-${CIRCLE_NODE_INDEX}
            set +e
            npx momentic run \
              --output-dir test-results/shard-${CIRCLE_NODE_INDEX} \
              --shard-index $(($CIRCLE_NODE_INDEX+1)) \
              --shard-count ${CIRCLE_NODE_TOTAL}
            test_status=$?
            echo "$test_status" > test-results/shard-${CIRCLE_NODE_INDEX}/exit-code

      - store_artifacts:
          path: ./test-results

      - persist_to_workspace:
          root: .
          paths:
            - test-results

      - run:
          name: Restore test exit code
          command: exit "$(cat test-results/shard-${CIRCLE_NODE_INDEX}/exit-code)"

  upload-results:
    docker:
      - image: cimg/node:22.12
    steps:
      - checkout
      - node/install-packages

      - attach_workspace:
          at: .

      - run:
          name: Merge test results
          command: npx momentic results merge --output-dir test-results/merged test-results

      - run:
          name: Upload test results
          command: npx momentic results upload test-results/merged

workflows:
  test:
    jobs:
      - run-tests
      - upload-results:
          requires:
            - run-tests:
              - success
              - failed
```

## Jenkins

Configure a NodeJS tool named `NodeJS 22` in [Jenkins](https://www.jenkins.io/)
with Node.js 22.12.0 or later in the 22.x line. Node.js 23 is unsupported.
Commit `package-lock.json` for `npm ci`, then create this `Jenkinsfile`:

```groovy Jenkinsfile theme={null}
pipeline {
    agent any

    tools {
        nodejs 'NodeJS 22'
    }

    stages {
        stage('Checkout Code') {
            steps {
                checkout scm
            }
        }

        stage('Install Dependencies') {
            steps {
                sh 'npm ci'
            }
        }

        stage('Install Browsers for Momentic') {
            steps {
                sh 'npx momentic install-browsers --all'
            }
        }

        stage('Run Momentic Tests and Upload Results') {
            steps {
                sh 'npx momentic run'
            }
            post {
                always {
                    sh 'npx momentic results upload test-results'
                }
            }
        }
    }
}
```

### Jenkins authentication

Add the `momentic-api-key` credential to your Jenkins instance.

1. Create an API key in the
   [Momentic dashboard](https://app.momentic.ai/settings/api-keys).

Copy the value. You add it as a CI secret in the next step.

2. In **Manage Jenkins > Credentials**, add a new global credential.

3. At the top of your `Jenkinsfile`, provide the following environment variables
   to the pipeline:

```groovy Jenkinsfile {4-6} theme={null}
pipeline {
    agent any

    environment {
        MOMENTIC_API_KEY = credentials('momentic-api-key')
    }
}
```

## Travis CI

For [Travis CI](https://docs.travis-ci.com/), create `.travis.yml` in your
repository:

```yaml .travis.yml theme={null}
language: node_js
node_js:
  - "22"
install:
  - npm install
  - npx momentic install-browsers chromium
script:
  - npx momentic run
after_script:
  - npx momentic results upload test-results
```

### Travis CI authentication

Set the `MOMENTIC_API_KEY` environment variable in your Travis repository
settings.

1. Create an API key in the
   [Momentic dashboard](https://app.momentic.ai/settings/api-keys).

Copy the value. You add it as a CI secret in the next step.

2. Go to your Travis repository settings and scroll down to the Environment
   Variables section. Create a new variable called `MOMENTIC_API_KEY` and enter
   the value of your API key.

3. Travis CI automatically loads environment variables stored in project
   settings into the CI environment. The CI file needs no changes.

## Buildkite

Run Momentic on [Buildkite](https://buildkite.com/docs).

Buildkite is auto-detected, so Momentic reads git metadata (branch, commit,
pipeline) from the agent.

Create a file called `.buildkite/pipeline.yml` in your repository with the
following contents:

```yaml .buildkite/pipeline.yml theme={null}
steps:
  - label: ":momentic: Test"
    commands:
      - npm install
      - npx momentic install-browsers --all
      - npx momentic run --upload-results
```

### Buildkite authentication

To run tests, you must authenticate with Momentic by providing the
`MOMENTIC_API_KEY` environment variable.

1. Create an API key in the
   [Momentic dashboard](https://app.momentic.ai/settings/api-keys).

Copy the value. You add it as a CI secret in the next step.

2. Store it with the
   [Buildkite secrets](https://buildkite.com/docs/pipelines/security/secrets)
   tooling your agents use: the `secrets` Buildkite plugin, your secrets
   manager, or an agent environment hook. Do not commit it to the pipeline file.
3. Expose it to the `momentic` steps as `MOMENTIC_API_KEY`:

```yaml .buildkite/pipeline.yml theme={null}
steps:
  - label: ":momentic: Test"
    env:
      MOMENTIC_API_KEY: "${MOMENTIC_API_KEY}"
    commands:
      - npm install
      - npx momentic install-browsers --all
      - npx momentic run --upload-results
```

### Buildkite sharding

Buildkite exposes the parallel job index as `BUILDKITE_PARALLEL_JOB` (0-indexed)
and the total as `BUILDKITE_PARALLEL_JOB_COUNT`. Momentic's `--shard-index` is
1-indexed, so add one. To collect every shard into a single run group in the
dashboard, add a step that merges and uploads results after the tests finish.

```yaml .buildkite/pipeline.yml theme={null}
steps:
  - label: ":momentic: Test %n"
    parallelism: 4
    artifact_paths:
      - "test-results/**/*"
    commands:
      - npm install
      - npx momentic install-browsers --all
      - |
        npx momentic run \
          --shard-index $(($BUILDKITE_PARALLEL_JOB + 1)) \
          --shard-count $BUILDKITE_PARALLEL_JOB_COUNT \
          --output-dir test-results/shard-$BUILDKITE_PARALLEL_JOB

  - wait: ~
    continue_on_failure: true

  - label: ":momentic: Merge and upload results"
    commands:
      - npm install
      - buildkite-agent artifact download "test-results/**/*" test-results
      - npx momentic results merge --output-dir test-results/merged test-results
      - npx momentic results upload test-results/merged
```

### Buildkite Test Analytics

Momentic can emit a Buildkite-format JSON report with the `buildkite-json`
[reporter](https://momentic.ai/docs/cli-reference/momentic/commands/run.md#output) for
[Buildkite Test Analytics](https://buildkite.com/docs/test-analytics):

```bash theme={null}
npx momentic run --reporter buildkite-json --reporter-dir reports
```

## Azure DevOps

Run Momentic on
[Azure Pipelines](https://learn.microsoft.com/azure/devops/pipelines).

Momentic detects Azure DevOps when `System.CollectionUri` contains `azure` and
reads git metadata from dotted environment variables such as
`Build.SourceVersion`.

Create a file called `azure-pipelines.yml` in your repository with the following
contents:

```yaml azure-pipelines.yml theme={null}
trigger:
  - main

pool:
  vmImage: ubuntu-latest

steps:
  - task: NodeTool@0
    inputs:
      versionSpec: "22.x"
    displayName: Install Node.js

  - script: npm install
    displayName: Install dependencies

  - script: npx momentic install-browsers --all
    displayName: Install browsers

  - script: npx momentic run
    displayName: Test
    env:
      MOMENTIC_API_KEY: $(MOMENTIC_API_KEY)

  - script: npx momentic results upload test-results
    displayName: Upload results
    condition: always()
    env:
      MOMENTIC_API_KEY: $(MOMENTIC_API_KEY)
```

### Azure DevOps authentication

To run tests, you must authenticate with Momentic by providing the
`MOMENTIC_API_KEY` environment variable.

1. Create an API key in the
   [Momentic dashboard](https://app.momentic.ai/settings/api-keys).

Copy the value. You add it as a CI secret in the next step.

2. Add it as a
   [secret pipeline variable](https://learn.microsoft.com/azure/devops/pipelines/process/set-secret-variables)
   named `MOMENTIC_API_KEY`. Mark it as secret so logs mask it. Do not commit it
   to the pipeline file.
3. Azure does not pass secret variables to scripts on its own. Map the variable
   into the environment of each `momentic` step with `env:`, as shown above.

### Azure DevOps sharding

Use a
[parallel job strategy](https://learn.microsoft.com/azure/devops/pipelines/process/phases)
and use the 1-indexed `System.JobPositionInPhase` and total
`System.TotalJobsInPhase` for `--shard-index` / `--shard-count`. To collect
every shard into a single run group in the dashboard, add a job that merges and
uploads results after the tests finish.

```yaml azure-pipelines.yml theme={null}
trigger:
  - main

pool:
  vmImage: ubuntu-latest

jobs:
  - job: test
    displayName: Run tests
    strategy:
      parallel: 4
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: "22.x"
      - script: npm install
      - script: npx momentic install-browsers --all
      - script: |
          npx momentic run \
            --shard-index $(System.JobPositionInPhase) \
            --shard-count $(System.TotalJobsInPhase) \
            --output-dir test-results/shard-$(System.JobPositionInPhase)
        displayName: Test
        env:
          MOMENTIC_API_KEY: $(MOMENTIC_API_KEY)
      - publish: test-results
        artifact: test-results-$(System.JobPositionInPhase)
        condition: always()

  - job: merge_results
    displayName: Merge and upload results
    dependsOn: test
    condition: always()
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: "22.x"
      - script: npm install
      - download: current
      - script: |
          npx momentic results merge --output-dir test-results/merged $(Pipeline.Workspace)
          npx momentic results upload test-results/merged
        displayName: Merge and upload
        env:
          MOMENTIC_API_KEY: $(MOMENTIC_API_KEY)
```


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