Mesrai
// cli

Reviews from your terminal.

Run the same multi-agent review on your machine, in CI, or as a pre-push hook. Same engine, same rules, same models — review before code ever leaves your laptop.

install
curl -fsSL https://mesrai.com/install | bash

with a team key

curl -fsSL https://mesrai.com/install | bash -s -- --team-key mesrai_xxxxx

npm direct

npm install -g @mesrai/cli && mesrai skills install
I.Where the CLI fits
4 workflows

Pre-push hook

local

Wire `mesrai review` into your git pre-push hook. Reviews run before code leaves your machine.

CI step

ci

Drop one shell line into GitHub Actions, GitLab CI, Bitbucket Pipelines, or Azure DevOps. Same engine, same rules, same models.

Branch batch

batch

Run `mesrai review --all` on a feature branch — get a single report across every changed file before you open the PR.

Mesrai Rules everywhere

rules

CLI reads the same Mesrai Rules + centralized config your cloud workspace uses. Local + remote review stay identical.

II.Core Commands
5 essentials
  • mesrai auth loginAuthorize the CLI to your workspace
  • mesrai reviewReview the current diff against base branch
  • mesrai review --files src/api/users.tsReview specific files only
  • mesrai review --severity highSet minimum severity threshold for output
  • mesrai rules syncPull latest Mesrai Rules from your workspace
III.Reviews show up in the cloud too
audit

Every CLI review lands in your workspace

CLI reviews appear under /cli-reviews in your Mesrai workspace — full audit trail of who ran what, when, and what findings shipped to the cloud or stayed local.

IV.Supported agents + IDEs
14 roots

mesrai skills install auto-detects every agent root present on the machine and writes its bundled skills into each one. A `.mesrai-managed-skills.json` manifest tracks which files this run owns — re-syncs are idempotent, uninstalls leave nothing behind.

  • Claude Code
  • Cursor
  • Codex
  • Windsurf
  • OpenCode
  • Goose
  • Gemini CLI
  • Kilo Code
  • Roo Code
  • AiderDesk
  • Agents
  • Antigravity
  • Droid
  • Kiro
  • + more local roots
V.How it works
3 steps
  1. 01

    Single installer

    One install URL updates the CLI and writes bundled Mesrai skills into every detected agent root on the machine — no separate repos, no per-IDE setup.

  2. 02

    Agent-friendly output

    `--agent`, `mesrai schema`, and `--fields` give skills, CI runners, and thin MCP layers a stable JSON envelope they can parse without scraping terminal output.

  3. 03

    Local + remote review flows

    `mesrai review` for local diffs against your team's Mesrai Rules. `mesrai pr suggestions` for fetching server-side suggestions on an existing GitHub/GitLab PR.

?Frequently asked
6 questions
  • How do I install the Mesrai CLI?+

    Two ways. (1) `npx mesrai` runs it without installing anything — best for one-off reviews or CI steps. (2) `npm install -g @mesrai/cli` installs it globally and exposes the `mesrai` binary. Both ship the same engine; pick based on whether you want the binary persistent on your machine.

  • Can I run reviews on my local machine before opening a PR?+

    Yes — that's the primary use case. `mesrai review` from the repo root reviews uncommitted + unpushed changes. Pair it with a Git pre-push hook (`mesrai install hook`) and every push is reviewed before it leaves your machine. Same engine as the cloud reviewer; same Mesrai Rules applied.

  • Does the CLI work in CI (GitHub Actions, GitLab CI, CircleCI)?+

    Yes. Add `npx mesrai review --ci` as a step in any CI runner — it auto-detects the PR base + head from the standard CI environment variables (GitHub Actions, GitLab CI, CircleCI, Buildkite, Jenkins). The CLI exits with a non-zero code if blocking-severity findings exist, so it slots cleanly into a required-check gate.

  • Where does the CLI store its config and credentials?+

    Config lives at `~/.config/mesrai/config.json` (Linux/macOS) or `%APPDATA%\mesrai\config.json` (Windows). Auth tokens are stored in the OS keychain (macOS Keychain, GNOME Keyring, Windows Credential Manager) — never in plaintext on disk. Rotate or revoke from Settings → CLI Tokens in the web app.

  • Can I review a specific branch or commit range?+

    Yes. `mesrai review --base main --head feature/x` reviews the diff between any two refs. `mesrai review --since HEAD~10` reviews the last 10 commits. `mesrai review path/to/file.ts` reviews a single file. Useful for batch-reviewing legacy branches or auditing a specific change set.

  • Does the CLI work offline or without internet?+

    Partially. The CLI ships an offline ruleset (~120 deterministic rules + lint checks) that runs entirely locally — no network required. The full multi-agent AI review needs a network call to either the Mesrai cloud (default) or your own LLM endpoint (BYOK). Local-only mode is enabled with `mesrai review --offline`.

// install

One npm install. Same engine.

Free CLI for free-tier workspaces. Get a CLI key from your workspace settings.