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

# momentic CLI

> Drive Momentic web tests locally and in CI.

The `momentic` CLI is the entry point for web testing. Install it as a dev
dependency, then invoke commands via `npx momentic <command>`.

## Install

```bash theme={null}
npm install --save-dev momentic
```

Every command assumes your project has a `momentic.config.yaml` at the root. Run
[`init`](/cli-reference/momentic/commands/init) to create one.

## Commands

<CardGroup cols={2}>
  <Card title="init" icon="folder-plus" href="/cli-reference/momentic/commands/init">
    Scaffold a new Momentic project.
  </Card>

  <Card title="app" icon="window" href="/cli-reference/momentic/commands/app">
    Open the local editor.
  </Card>

  <Card title="run" icon="play" href="/cli-reference/momentic/commands/run">
    Run tests locally and optionally upload results.
  </Card>

  <Card title="snapshot" icon="camera" href="/cli-reference/momentic/commands/snapshot">
    Freeze tests into self-contained zips for isolated replay.
  </Card>

  <Card title="results" icon="file-lines" href="/cli-reference/momentic/commands/results">
    Upload, merge, and view local test results.
  </Card>

  <Card title="list" icon="list" href="/cli-reference/momentic/commands/list">
    List tests matching a pattern.
  </Card>

  <Card title="queue" icon="cloud-arrow-up" href="/cli-reference/momentic/commands/queue">
    Queue a run on Momentic infrastructure (deprecated).
  </Card>

  <Card title="lint" icon="spell-check" href="/cli-reference/momentic/commands/lint">
    Validate simplified format test and module YAML files.
  </Card>

  <Card title="check" icon="check" href="/cli-reference/momentic/commands/check">
    Detect duplicate IDs and validate `momentic.config.yaml`.
  </Card>

  <Card title="import" icon="download" href="/cli-reference/momentic/commands/import">
    Import tests from the Momentic dashboard.
  </Card>

  <Card title="apply" icon="wand-magic-sparkles" href="/cli-reference/momentic/commands/apply">
    Apply patch changes to local tests (deprecated).
  </Card>

  <Card title="quarantine" icon="ban" href="/cli-reference/momentic/commands/quarantine">
    Quarantine or unquarantine tests.
  </Card>

  <Card title="ai" icon="robot" href="/cli-reference/momentic/commands/ai">
    AI-assisted classification and authoring.
  </Card>

  <Card title="mcp" icon="plug" href="/cli-reference/momentic/commands/mcp">
    Start the MCP server for coding agents.
  </Card>

  <Card title="install-browsers" icon="globe" href="/cli-reference/momentic/commands/install-browsers">
    Install or update headless browsers.
  </Card>

  <Card title="install-skills" icon="brain" href="/cli-reference/momentic/commands/install-skills">
    Install Momentic skills for editors (deprecated).
  </Card>
</CardGroup>

## Global flags

These flags are accepted by every command that talks to the Momentic API or
loads a project. Per-command pages document any other flags they accept.

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

<ParamField path="--server <server>" type="string">
  Momentic server URL. Defaults to `https://api.momentic.ai`. Env:
  `MOMENTIC_SERVER`.
</ParamField>

<ParamField path="-c, --config <configPath>" type="string">
  Absolute or relative path to a Momentic configuration file. Defaults to
  `momentic.config.yaml` in the current directory.
</ParamField>

<ParamField path="-f, --filter <filter>" type="string">
  When using [workspaces](/configuration/workspace), load the project whose name
  matches the filter. Substring matches are allowed.
</ParamField>

<ParamField path="-y, --yes" type="boolean">
  Skip all confirmation prompts. Enabled by default when `CI` is set.
</ParamField>

<ParamField path="--verbose" type="boolean">
  Enable verbose logging to stderr.
</ParamField>

## Environment variables

| Variable           | Purpose                                                           |
| ------------------ | ----------------------------------------------------------------- |
| `MOMENTIC_API_KEY` | Auth token. Required for any command that talks to the dashboard. |
| `MOMENTIC_SERVER`  | Override the API host.                                            |

See [Environment variables](/configuration/environment-variables) for the full
list.
