Skip to main content
Mirra’s CLI is built to run in CI. This guide shows the full wiring for the three common platforms and the patterns that keep the integration fast and flake-free.

The goal

A CI run that:
  1. Installs the Mirra CLI.
  2. Runs every scenarios/*.md in your repo.
  3. Fails the job if the satisfaction score drops below a threshold you pick.
  4. Uploads a result artifact for inspection on failure.

Prerequisites

A Mirra personal access token from app.mirra.run/settings/tokens. Scope it to the workspace and project you’re testing. Store it in your CI’s secret store (GitHub secrets, GitLab variables, CircleCI contexts).

GitHub Actions

Breakdown:
  • concurrency block — kills the previous run on the same PR when a new commit lands. Important because scenario runs burn minutes.
  • --runs=3 — executes every scenario three times for statistical satisfaction. Don’t drop below 2; don’t go above 5 unless you’ve got a flake problem to quantify.
  • --fail-below=0.9 — PR fails if fewer than 90% of criteria pass across runs. Tune per repo: stricter for infrastructure, looser for rapidly-changing integration code.
  • --json output — machine-readable, easy to parse in downstream steps, easy to archive.
  • if: always() on artifact upload — uploads the result even on job failure so you can inspect.

GitLab CI

MIRRA_TOKEN goes in Settings → CI/CD → Variables as a protected, masked variable.

CircleCI

MIRRA_TOKEN lives in a CircleCI context named mirra, restricted to the scenarios job.

Patterns that work

Fail-below per scenario, not per-suite

For critical scenarios, split them out and gate stricter:
This catches “payment-flow.md silently regressed” while letting the long tail run without halting CI on every flake.

Cache warm sessions across jobs

If a single workflow runs scenarios across many jobs, reuse a session:
Cuts provisioning overhead from N × 2s to 1 × 2s per job.

Post the satisfaction score to the PR

Parse the JSON and comment on the PR:

Troubleshooting

Cold start is sub-2s; warm start is ~2s when the session-cache hits. If you’re consistently seeing 5s+ starts, your workflow isn’t hitting the cache — check that mirrors, seeds, and workspace are stable between runs.
You’ve hit your plan’s monthly minute cap. Either upgrade or reduce --runs. Overage billing is enabled by default — see pricing.
Almost always a timing issue. Bump timeout: in the scenario’s ## Config, or add resetBetweenTests: true if you’re running inside Vitest.
Add mirror-version: to each scenario’s ## Config. See Fidelity — versioning.

Where to go next

First scenario

Write the scenario CI will run.

mirra run reference

Every flag, every exit code.