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

Published on npm as @mesrai/cli — or run it without installing: npx @mesrai/cli review

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 --branch main` 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 your modified files
  • mesrai review src/api/users.tsReview specific files only
  • mesrai review --fail-on errorExit with code 1 when issues reach a severity (CI gate)
  • mesrai hook installReview every push with a Git pre-push hook
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?

    +

    Three ways. (1) The one-line installer — `curl -fsSL https://mesrai.com/install | bash` on macOS or Linux, or the PowerShell command on this page — installs the CLI and sets up Mesrai skills for your AI coding agents. (2) `npm install -g @mesrai/cli` installs the `mesrai` command globally. (3) `npx @mesrai/cli review` runs it without installing anything. The CLI needs Node.js 20 or later and is published on npm as @mesrai/cli.

  • 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 your modified files, and `mesrai review --staged` reviews only staged changes. Run `mesrai hook install` to add a Git pre-push hook so every push is reviewed before it leaves your machine. Your team's Mesrai Rules apply, the same as in pull request reviews.

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

    +

    Yes. Create a CI token with `mesrai auth token` (or use a team key), store it as the `MESRAI_TOKEN` (or `MESRAI_TEAM_KEY`) secret, and add `npx @mesrai/cli review --branch main --fail-on error` as a step in GitHub Actions, GitLab CI, Bitbucket Pipelines, Azure DevOps or any other runner. `--fail-on` makes the step exit with code 1 when findings reach that severity, so it works as a required check.

  • Where does the CLI store its credentials?

    +

    After `mesrai auth login`, credentials are saved in `~/.mesrai/credentials.json`, in a folder only your user account can read. `mesrai auth logout` removes them. In CI, pass the `MESRAI_TOKEN` or `MESRAI_TEAM_KEY` environment variable instead of logging in.

  • Can I review a specific branch or commit range?

    +

    Yes. `mesrai review --branch main` reviews your current branch against `main`. `mesrai review --commit <sha>` reviews the changes in one commit. `mesrai review src/auth.ts src/config.ts` reviews only those files. Add `--format json` or `--format markdown` with `--output <file>` to save a report.

  • Does the CLI need an internet connection?

    +

    Yes. The CLI sends your diff to the Mesrai review engine, which reviews it with the LLM you've configured, so it needs network access to Mesrai. On a self-hosted Enterprise install, that engine runs inside your own network. For a quicker pass use `mesrai review --fast`; `--rules-only` checks only your Mesrai Rules.

// install

One npm install. Same engine.

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