Prerequisite: Please install Node.js (version 18 or higher) before proceeding.

Step 1: Install the CLI:

npm install momentic

Step 2: Get an API key from Momentic Cloud:

You can export the API key in your shell configuration file (usually .bashrc or .zshrc) like so:

export MOMENTIC_API_KEY=your-api-key

Step 3: Initialize a new project by running the following command:

npx momentic init

Step 4: Start the Momentic Local App by running the following command:

npx momentic app

Additional Commands

While momentic app is the most commonly used command, there are other commands you can use to manage your tests.

Run tests locally

Prerequisites: These tests must exist locally as YAML files.

To execute tests locally, use the following command:

npx momentic run <tests...>

All tests executed in CI environments will automatically upload results. You can also upload results manually by including CI=true before the command:

CI=true npx momentic run <tests...>

Run tests remotely

Prerequisites: These tests must exist in Cloud.

To execute tests remotely, use the following command:

npx momentic queue tests <tests...>

Check duplicate IDs

The CLI can assist with validating step and command IDs. To identify any duplicates IDs, use the following command:

npx momentic check duplicate-ids

Check duplicate names

You can use the CLI to check tests and modules for duplicate names using the following command:

npx momentic check duplicate-names

Check config

You can use the CLI to check momentic.config.yaml for errors using the following command:

npx momentic check-config