This guide gets you from zero to a reviewed diff in under five minutes.
- 1
Install
Installs the CLI and deploys Mesrai skills to all detected AI agents (Claude Code, Cursor, Codex, Windsurf):
curl -fsSL https://review-skill.com/install | bashRequires Node.js >= 20.0.0.Verify the install:
mesrai --version mesrai status - 2
Authenticate
Pick the path that matches your situation. You can also skip auth and run
mesrai reviewdirectly — it works in trial mode with daily limits.Sign in with a personal account:
mesrai auth loginTokens are stored in
~/.mesrai/credentials.jsonand auto-refreshed.Self-hosting Mesrai? Point the CLI to your API before authenticating:
export MESRAI_API_URL=https://mesrai-api.yourcompany.comHTTPS is required except for
localhost.Confirm the auth state:
mesrai auth status - 3
Run your first review
Inside any git repository with uncommitted changes:
mesrai reviewThe CLI analyzes your working tree diff, prints a summary, and (in interactive mode) lets you browse file-by-file, preview suggested fixes, and apply them.
Common variations:
mesrai review --staged # Only staged files mesrai review --branch main # Compare current branch against main mesrai review --commit abc123 # Analyze a single commit mesrai review --fix # Auto-apply every fixable issue mesrai review --prompt-only # Compact output for AI agents mesrai review --fail-on error # Exit non-zero on error-or-worse (CI-friendly)Working-tree reviews (default) and
--stagedinline file contents so the backend sees your uncommitted changes.--branchand--commitmodes skip inlining since the backend can fetch those commits itself — this is why those modes work well on huge branches. - 4
Choose what's next
Depending on your goal:
Automate on every push
Install the pre-push hook with
mesrai hook install.Run reviews in CI
GitHub Actions, GitLab CI, and generic pipeline examples.
Plug into an AI agent
Feed
--prompt-onlyinto Claude Code, Cursor, or Codex for autonomous fix loops.Configure the repo
Manage ignored files, base branches, and review settings from the CLI.
Environment Variables
These env vars configure the CLI across all commands.
| Variable | Description |
|---|---|
MESRAI_API_URL | API endpoint (default: https://api.mesrai.com) |
MESRAI_TEAM_KEY | Team key for shared access and AI agents |
MESRAI_TOKEN | CI/CD token generated via mesrai auth token |
MESRAI_VERBOSE | Set to true for verbose output |
MESRAI_SKIP_HOOK | Set to 1 to skip the pre-push hook for a single git push |
MESRAI_REQUEST_TIMEOUT_MIN | Per-request timeout in minutes (default: 60) |
CF_ACCESS_CLIENT_ID | Cloudflare Access client ID (APIs behind Zero Trust) |
CF_ACCESS_CLIENT_SECRET | Cloudflare Access client secret |
For self-hosted setups, tokens, and Cloudflare Access, see Self-Hosted Setup.
Troubleshooting
Ran into an error? Check the Troubleshooting guide for common symptoms and fixes.