Skip to content

CLI reference

The yomorai command runs reviews locally with the same engine as a deployment (local Chromium, SQLite and an evidence folder), or drives a deployment’s API with --remote. Source: apps/cli/src/commands/.

Terminal window
npx yomorai <command> [flags] # or, from a clone: node apps/cli/src/bin.ts

Below, yomorai stands for either. Every command accepts --help and --json. Human-readable output goes to stdout, progress and diagnostics to stderr. With --json, an error is printed as { "error": { "code", "message", "retryable" } } (codes: Troubleshooting). Values of environment variables whose names end in TOKEN, SECRET, PASSWORD, API_KEY or PRIVATE_KEY, and a token given with --token, are replaced by [REDACTED] in all output.

Code Meaning
0 Success. For review: completed with no confirmed regression or unintended change at or above report.failOn.
1 review: such findings exist (remote: the conclusion is failure). doctor: a check failed. evidence export, evidence verify, audit verify: verification failed.
2 Configuration, input or authorization error: invalid configuration, unknown review, missing or rejected token, refused approval, unknown flag.
3 Incomplete: the review failed, was cancelled, exhausted its budget, or (remote) is waiting for approval; or the deployment could not be reached.

Errors with the codes invalid_config, invalid_input, not_authorized, not_found and origin_not_allowed exit 2; every other error exits 3.

Terminal window
yomorai init [--dir <dir>] [--force] [--repo owner/name]

Writes a commented starter yomorai.config.yaml (with placeholder origins to edit) and .yomorai/project.json. Refuses to overwrite an existing configuration without --force (exit 2).

Terminal window
yomorai init --cloudflare [--dry-run] [--name <name>] [--worker-url <url>] [--yes]

Walks through a self-hosted installation, step by step: GitHub App manifest, D1 database, R2 bucket, six secrets, model keys, migrations, deploy, doctor. --dry-run prints the manifest and every command and runs nothing. Without it, --worker-url is required, the manifest is written to .yomorai/github-app-manifest.json, and each step that creates a cloud resource asks before it runs (--yes answers yes). A failed step stops the walk-through with exit 3. --name (default yomorai) names the Worker, database and GitHub App. The steps are listed in Self-hosting.

Terminal window
yomorai connect --repo owner/name [--url <deployment>] [--token <token>]

Links the working directory to a repository and optionally a deployment (.yomorai/project.json). With --url, the token (from --token or YOMORAI_TOKEN) is first checked against GET /api/me; a token given with --token is stored in ~/.config/yomorai/credentials.json with mode 0600. A credentials file readable by other users is refused.

Terminal window
yomorai doctor [--config <path>] [--url <deployment>]

Checks, each PASS, WARN or FAIL with a reason:

Check Fails when
node Node is older than 22.5 (the built-in SQLite module is needed)
config the configuration is invalid (missing file or placeholder example.com origins are warnings)
chromium Playwright’s Chromium does not launch
lighthouse never; a warning when performance measurement is unavailable
model:visual, model:reasoning a configured model’s key is not set, the provider is unreachable, the model is not offered, or it cannot return JSON (and, for visual, accept an image). Nothing is substituted.
tracing a configured trace destination is unreachable
deployment the linked deployment is unhealthy or its database schema is behind
java, tla-tools never (optional, for contributors running pnpm tlc)

Exit 0 when no check failed; warnings do not fail.

Terminal window
yomorai review --production <url> --preview <url> [flags]
Flag Meaning
--production <url>, --preview <url> The two deployments. https, or http on localhost / 127.0.0.1; no credentials in the URL. Their origins are added to the allowlists for this run, and the output says so.
--pr <n> with --repo owner/name Read the pull request (title, description, diff, source files) from GitHub when GITHUB_TOKEN is set. Without it the intent is unknown, and the output says so. --repo defaults to the linked project.
--categories <list> Only these of visual,dom,accessibility,functional,performance,runtime; the others are reported not_requested.
--routes <list> Only these routes, e.g. /,/pricing. A route named here is visited even when the change is not known to affect it.
--viewports <list> Only these viewport profiles.
--config <path> Configuration file. Default: yomorai.config.yaml, .yml, .json or .github/yomorai.yaml in the working directory; without one, a minimal built-in configuration is used and noted.
--data-dir <dir> Where reviews and evidence are stored (default .yomorai/data).
--no-models Call no model. Otherwise configured models are used when their API keys are in the environment; a model whose key is missing is skipped and noted.
--html <file> Also write the report as HTML.
--trace Export a trace to the destination configured in the environment (Observability).
--json One JSON document: reviewId, status, exitCode, failedStage, conclusion, partial, partialReasons, failOn, categories, intent, findings, failingFindingIds, evidenceGaps, allowlisted, notes, costUsd, spend (the review’s spend view).

When the review finishes, its estimated cost is printed: the total, by category, by model and by stage, the price table and its date, and the statement that the amounts are estimates and the provider’s billing is authoritative. yomorai spend <review-id> shows it again.

The production guard is the same as in a deployment. Authentication profiles are not used by yomorai review.

Terminal window
yomorai review --remote --pr <n> [--repo owner/name] [--url <deployment>]

Asks the deployment to review the pull request and follows its events until it finishes or waits for a person. A pull request that needs approval prints the yomorai approve command for it and exits 3. The Cloudflare deployment accepts only prNumber: passing --production, --preview, --categories, --routes or --viewports with --remote is refused with invalid_input, because a deployment takes these from the repository configuration.

Each of these reads the local data directory, or the deployment with --remote (and --url). Shared flags: --remote, --url <deployment>, --data-dir <dir>, --json.

Command What it does
yomorai status <review-id> State, stages, failure and finding counts.
yomorai findings <review-id> [--severity a,b] [--classification a,b] Lists findings. With --json, an array that validates against the Finding schema.
yomorai evidence export <review-id> --out <file.tar> Writes the review, its findings and its evidence to one archive with a manifest of SHA-256 hashes, then reads it back and checks every hash. Exit 1 on a mismatch.
yomorai evidence verify <file.tar> Rechecks the hashes of an archive. Exit 1 on a mismatch.
yomorai tests generate <review-id> [--out <dir>] [--export files|patch|pull-request] [--branch <name>] Lists the review’s Playwright test candidates. --export writes the approved candidates only, as files (default directory tests/yomorai), a patch, or (with --remote) a pull request on a new branch.
yomorai approve <pr-or-review-id> --sha <sha> [--repo owner/name] Approves the review of exactly that commit (at least 7 hex characters, matched against the current head only). Exit 2 with the reason when refused.
yomorai audit verify Recomputes the audit hash chain. Exit 1 and the position of the first break when a record was changed, removed or reordered.
yomorai spend [review-id] [--period YYYY-MM|YYYY-MM-DD] [--installation] [--repo owner/name] Estimated spend from the spend ledger: of one review (by category, model and stage, with its model calls), or of the repository (or the whole installation) for a month or a day. Names the price table and its date and says the amounts are estimates. Exit 1 when the ledger fails its integrity check.
yomorai memory list [--repo owner/name] Repository memory: remembered differences and noise masks (active, expired, removed, with who created them and when they expire), and proposed masks waiting for a maintainer.
yomorai memory remember <review-id> <finding-id> [--kind accepted_baseline] [--days 30] Remembers a finding as an accepted difference (--kind accepted_baseline) or a noise mask (--kind noise_mask) for its route, viewport and fingerprint, for --days (default 30, at most 180). A deterministic failure is refused (deterministic_failure_not_acceptable).
yomorai memory accept <candidate-id> [--days 30] Accepts a proposed noise mask; until then it applies to nothing.
yomorai memory renew <entry-id> [--days 30] Extends an entry from now.
yomorai memory remove <entry-id> Removes an entry. Locally the person running these commands owns the data and acts as maintainer; with --remote the deployment checks maintainer permission and audits every action.
Terminal window
yomorai serve [--port <n>] [--host <h>] [--data-dir <dir>] [--config <path>]

Starts the HTTP API (the same API a deployment serves) for the local data directory, on 127.0.0.1:4319 by default (--port 0 picks a free port), and prints its URL and an API token generated for this run.

Terminal window
yomorai mcp

Starts the MCP server on stdio, for coding agents (npx -y yomorai mcp in an agent’s MCP configuration). YOMORAI_URL and YOMORAI_TOKEN select the remote backend; otherwise reviews run locally. Tools and safety: MCP server.

Terminal window
yomorai install-browser [--with-deps]

Installs the Chromium build that the Playwright version Yomorai runs with expects; once per machine. --with-deps also installs Chromium’s system libraries on Linux. A plain npx playwright install may install the build of another Playwright version, which Yomorai then cannot launch.

Variable Used for
YOMORAI_URL Deployment URL for remote mode (after --url, before the project file)
YOMORAI_TOKEN API token for remote mode (before the credentials file)
GITHUB_TOKEN, GITHUB_API_URL Reading a pull request for review --pr
DEEPSEEK_API_KEY, MODEL_API_KEY, CLOUDFLARE_API_TOKEN with CLOUDFLARE_ACCOUNT_ID, or the name in apiKeySecret Model keys
LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_BASE_URL, or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS Trace destination for --trace
XDG_CONFIG_HOME, HOME Location of yomorai/credentials.json
TLA_TOOLS_JAR Path of the TLA+ tools for the contributor check in doctor
Path Content
yomorai.config.yaml Repository configuration (reference)
.yomorai/project.json { "repository": "owner/name", "url": "<deployment>" }
.yomorai/data/ Local reviews: yomorai.sqlite and evidence/
~/.config/yomorai/credentials.json API tokens by deployment origin, mode 0600

A local review goes through the same coordinator as a deployment: the review is created for the commit, approved by the local user (recorded in the audit log as approver), and published to the local store only if the commit is still current. When the preview reports its commit on the configured buildIdPath, that commit is recorded; otherwise a local run identifier is used.