Skip to main content
This quickstart takes you from nothing installed to a first policy check in a few minutes. By the end you will have the CLI installed, an authenticated session, and your first findings on real code.
Prerequisites: Python 3.11 or newer, and a MergeGuide account. Create one at portal.mergeguide.ai. You will also need an API key from the dashboard for headless login (or you can log in interactively).
mergeguide init is the first-run orchestrator. After installing the CLI, a single command authenticates you, installs the MCP server, and wires up your git hooks.
1

Install the CLI

pip install mergeguide
Verify it installed:
mergeguide --version
2

Run the first-run setup

mergeguide init --api-key mg_xxxxxxxxxxxxxxxx
init is idempotent — it preflights your environment, writes .mergeguide/config.yaml, authenticates against the dashboard, installs the @mergeguide/mcp-server npm package via npx, registers it in your project’s .mcp.json, and installs git pre-commit / pre-push hooks. Re-running it on a configured install is a fast no-op.
Omit --api-key to be prompted interactively. In CI, pass the key explicitly — init fails fast in non-interactive environments rather than hanging on a prompt.
3

Run your first check

mergeguide check
With no paths, check reads your staged changes (or from stdin). Pass paths to check specific files or directories:
mergeguide check src/

Option B — step by step

If you would rather set up each piece yourself:
1

Install the CLI

pip install mergeguide
2

Authenticate

mergeguide login --api-key mg_xxxxxxxxxxxxxxxx
Or run mergeguide login with no flags to authenticate interactively. Confirm who you are signed in as:
mergeguide auth whoami
3

Check your setup

mergeguide doctor
doctor diagnoses your configuration and connectivity and reports anything that needs attention.
4

Run a check

mergeguide check src/

Reading the result

check prints each finding with its file, line, severity, and remediation guidance, then exits:
  • Exit code 0 — no blocking findings.
  • Exit code 1 — policy violations were found.
  • Exit code 2 — a configuration or environment error.
To get machine-readable output for tooling or CI, choose a format:
mergeguide check src/ --format json
mergeguide check src/ --format sarif --output results.sarif

Next steps

Install the rest

Add the MCP server, IDE extension, git hooks, and the PR gate.

Configure policies

Set up .mergeguide.yaml and choose your frameworks.

CLI reference

Every command and flag in detail.

Core concepts

The vocabulary the rest of the docs use.