Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI

Two programs are called miroir: the Rust binary inside the env image, and the Python CLI on the host.

In the image

CommandDoes
miroir runserves the env; the image’s default command. See Serve an env
miroir bakeseeds every world and keeps its state, at image build. See the manifest
miroir checkchecks that the env and its tasks grade reliably. See Check the env
miroir sandboxserves the sandbox that runs the agent’s code, in a container of its own
miroir importscrubs production dumps and traces into seed data. See Import
miroir export harborwrites each task as a Harbor task. See Run in Harbor

check takes --json, --mutate and --world W.

import takes --dump APP=FILE (one per app), --scrub FILE, --key FILE, --out DIR and, optionally, --traces FILE.

export harbor takes --image IMAGE, the env image as Harbor’s Docker finds it, and --out DIR, empty or missing.

miroir --version prints the version. Every command must run as the container’s entrypoint, or as a child of its init.

On the host

Install with uv pip install miroir.

CommandDoes
miroir pool --size N --urls FILE -- COMMAND...keeps N containers healthy, listed in FILE. See Pools
miroir review TRACES... --tasks DIRlabels end states; wrong grades become probes. See Review grades
miroir calibrate TRACES... --model M --out FILEclasses tasks as solved, learnable or out of reach. See Calibrate tasks
miroir draft TRACES --world W --tasks DIRwrites a draft task for each scrubbed trace. See Tasks from traces
miroir derive URL TRACES --world W --tasks DIRreplays the drafts and writes their checks
OptionOfWhat
--jsonreviewprint the queue as JSON, and ask nothing
--label TASK@SIGNATURE=LABELreviewlabel without asking: correct, should_fail or should_pass
-k Kcalibratek for pass@k and pass^k; by default the most rollouts of a task
--split Sdraftthe drafts’ split; train by default
--token-var VARderivethe variable that holds the env’s MIROIR_TOKEN

TRACES are the record files the adapters save, or directories of them. For draft and derive, it is the traces.jsonl that miroir import writes.