Skip to main content

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.

Install via the wizard

Run the onboarding wizard from your terminal, or copy the prompt below into an LLM coding agent (Cursor, Claude, etc.):
npx @momentic/wizard@latest
It gets you to a passing test in about two minutes: sign-in, install, sample test run, and editor MCP setup, all in one flow.

Set up Momentic for a web project end to end via the onboarding wizard.

CursorOpen in Cursor
Or, to install manually, continue with the rest of this guide.

1. Prerequisites

  • Node.js 20.19.0+, 22.12.0+, or 24.0.0+
  • A package.json in your project (run npm init -y if you don’t have one)
  • A Momentic account, sign up to generate an API key
node -v  # must print v20.19.0 or higher

2. Install

npm install --save-dev momentic@latest

3. Authenticate

Option A: sign in with your browser (recommended):
npx @momentic/wizard login
This opens a browser-based login flow and saves credentials to ~/.momentic/auth.json. Both CLIs automatically use this file when MOMENTIC_API_KEY is not set. Option B: use an API key: Create an API key in the dashboard, then export it:
export MOMENTIC_API_KEY=your-api-key-here
Persist the key by appending the export line to ~/.zshrc (macOS) or ~/.bashrc (Linux). In CI, set MOMENTIC_API_KEY as a secret environment variable.

4. Initialize

npx momentic init
This writes momentic.config.yaml to your project root. init does not scaffold any tests; author your first one in the editor below. (For pre-scaffolded sample tests, use the onboarding wizard instead.)

5. Install browsers

Momentic runs your tests against a headless browser. Install Chromium:
npx momentic install-browsers chromium

6. Write and run your first test

Open the local editor:
npx momentic app
Create a test with base URL https://practicetestautomation.com/practice-test-login/ and author a single natural-language step (for example, Log in with username "student" and password "Password123", then confirm the success page loads.). Save it (the editor writes the .test.yaml to your project), run it from the editor to verify, then run it from the CLI by name:
npx momentic run <your-test-name>

7. Verify

  • Check the .test.yaml you just authored exists in your project root
  • Open the dashboard and check Runs for the result

8. Next steps

Core concepts

Finding elements, writing assertions, modules, variables

CI/CD

Run Momentic on every pull request

Best practices

Write tests that hold up over time
Need a full working example? Clone momentic-ai/examples.