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

# Jenkins

> Run Momentic tests from a Jenkins pipeline.

Use this example pipeline to run Momentic tests on
[Jenkins](https://www.jenkins.io/). More reference configs live in
[momentic-ai/examples](https://github.com/momentic-ai/examples).

Given this root `package.json`:

```json package.json theme={null}
{
  "name": "my-momentic-repo",
  "scripts": {},
  "devDependencies": {
    "momentic": "latest"
  }
}
```

Configure a NodeJS tool named `NodeJS 22` in Jenkins 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'
                }
            }
        }
    }
}
```

## Authentication

To run any commands, you must authenticate with Momentic. 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).

<Frame>
  <img src="https://mintcdn.com/momentic-docs/N47HcAM-4dLVFPuL/images/create-api-key.png?fit=max&auto=format&n=N47HcAM-4dLVFPuL&q=85&s=54eb9f3c01e00a3ae7d71996760dcd39" alt="Create an API key in Momentic settings" width="3616" height="2434" data-path="images/create-api-key.png" />
</Frame>

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

2. Add a new global credential to your Jenkins controller.

<Frame>
  <img src="https://mintcdn.com/momentic-docs/N47HcAM-4dLVFPuL/images/ci/jenkins-credentials.png?fit=max&auto=format&n=N47HcAM-4dLVFPuL&q=85&s=9a3ab99eaf8a2c514dd4f12910ee57f3" alt="Add a global credential in Jenkins" width="1440" height="861" data-path="images/ci/jenkins-credentials.png" />
</Frame>

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

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

    // To authenticate, set the following environment variables.
    environment {
        MOMENTIC_API_KEY = credentials('momentic-api-key')
    }

    // ...
}
```


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