Pre-push hook
localWire `mesrai review` into your git pre-push hook. Reviews run before code leaves your machine.
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.
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
Wire `mesrai review` into your git pre-push hook. Reviews run before code leaves your machine.
Drop one shell line into GitHub Actions, GitLab CI, Bitbucket Pipelines, or Azure DevOps. Same engine, same rules, same models.
Run `mesrai review --branch main` on a feature branch — get a single report across every changed file before you open the PR.
CLI reads the same Mesrai Rules + centralized config your cloud workspace uses. Local + remote review stay identical.
mesrai auth loginAuthorize the CLI to your workspacemesrai reviewReview your modified filesmesrai review src/api/users.tsReview specific files onlymesrai review --fail-on errorExit with code 1 when issues reach a severity (CI gate)mesrai hook installReview every push with a Git pre-push hookCLI 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.
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.
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.
`--agent`, `mesrai schema`, and `--fields` give skills, CI runners, and thin MCP layers a stable JSON envelope they can parse without scraping terminal output.
`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.
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.
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.
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.
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.
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.
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.
Free CLI for free-tier workspaces. Get a CLI key from your workspace settings.