Skip to main content
The MergeGuide CLI ships as the Python package mergeguide and installs a single mergeguide executable.
pip install mergeguide
Requires Python 3.11 or newer. See Install the CLI for details.

Global options

These apply to mergeguide before any subcommand:
OptionDescription
-q, --quietMinimal output — only violations and errors.
-v, --verboseDebug output (cache status, timing, and similar).
--versionPrint the version and exit.
--helpShow help for the command and exit.

Command overview

The CLI has nine top-level commands and five command groups:
CommandWhat it does
checkCheck files against policies.
initOne-shot first-run setup (config, auth, MCP server, hooks).
bootstrapInstall Semgrep, install git hooks, emit MCP config.
policiesList available policies.
completionsGenerate a shell completion script.
doctorDiagnose configuration and connectivity.
loginAuthenticate with the dashboard.
installInstall or uninstall the agent PreToolUse hook.
verify-evidenceVerify a signed evidence artifact.
authAuthentication subcommands (login, whoami, logout).
configManage configuration.
hooksManage git hooks.
sbomGenerate a Software Bill of Materials.
scanRun the vulnerability and IaC scanners.

mergeguide check

Check files against policies.
mergeguide check [OPTIONS] [PATHS]...
PATHS are files or directories to check. With no paths, check reads git-staged changes (or from stdin).
OptionDescription
-f, --format [text|json|sarif|markdown]Output format.
-o, --output PATHWrite output to a file.
-p, --policy PATHAdditional policy file(s) to use.
--no-defaultsDon’t use the default policies.
--fail-on-warningExit with an error if warnings are found.
--stagedCheck only git-staged files (for pre-commit hooks).
--hook-modeConcise output for git hooks (no spinner).
--advisoryReport findings but always exit 0 (never block).
--no-semgrepDisable Semgrep scanning.
--semgrep-timeout INTEGERSemgrep scan timeout in seconds (default 300).
--localRun locally without submitting results to the dashboard.
--show-low-confidenceShow low-confidence findings in text output.
--tier [free|team|enterprise]Organization tier used for absence-of-controls gating (default free).
--frameworks TEXTComma-separated framework IDs to scope the default rule corpus to (for example soc2-type2,pci-dss-v4). When supplied, only rules mapped to at least one of these frameworks fire.
mergeguide check src/ --format json
mergeguide check --staged --fail-on-warning
mergeguide check src/ --frameworks soc2-type2,pci-dss-v4

mergeguide init

One-shot first-run orchestrator. After pip install mergeguide, run init to preflight your environment, write config, authenticate, install the MCP server via npx, register it in your project’s .mcp.json, and install git hooks. Every step is idempotent.
mergeguide init [OPTIONS]
OptionDescription
--globalInitialize globally in ~/.mergeguide (config scope only).
--api-key TEXTAPI key for authentication; prompts if omitted.
--api-url TEXTDashboard URL (default https://portal.mergeguide.ai).
--skip-authConfig only — skip the dashboard auth step.
--skip-mcp-serverSkip installing the @mergeguide/mcp-server npm package.
--skip-agent-hookSkip installing the agent PreToolUse hook.
--skip-git-hooksSkip installing git hooks.
--agent-hook-scope [user|project]PreToolUse hook scope (default user).
--forceOverwrite non-MergeGuide hook entries.

mergeguide bootstrap

Install Semgrep, install git hooks, and emit MCP config in one step. Each step is best-effort and idempotent.
mergeguide bootstrap [OPTIONS]
OptionDescription
--skip-semgrepSkip the Semgrep install step.
--skip-hooksSkip the git hooks install step.
--write-mcp-config FILEWrite the MCP config snippet to this path.

mergeguide policies

List the policies available to you.
mergeguide policies

mergeguide completions

Generate a shell completion script for bash, zsh, or fish.
mergeguide completions bash >> ~/.bashrc
mergeguide completions zsh >> ~/.zshrc
mergeguide completions fish > ~/.config/fish/completions/mergeguide.fish

mergeguide doctor

Diagnose MergeGuide configuration and connectivity. Run this first when something isn’t working.
mergeguide doctor

mergeguide login

Authenticate with the dashboard. This is a top-level alias for mergeguide auth login.
mergeguide login [OPTIONS]
OptionDescription
--api-key TEXTAPI key for authentication (alternative to interactive login).
--api-url TEXTDashboard URL.

mergeguide install

Install or uninstall the MergeGuide PreToolUse hook for an AI agent runtime.
mergeguide install --agent-hook [claude-code|cursor|codex-cli|copilot-chat|all] [OPTIONS]
OptionDescription
--agent-hook [claude-code|cursor|codex-cli|codex|copilot-chat|copilot|all]Runtime to install the hook for (required). all installs for every detected runtime.
--uninstallSymmetrically uninstall the agent hook.
--scope [project|user]Install scope (default project).
--forceReplace an existing entry even on marker drift.

mergeguide verify-evidence

Verify a signed MergeGuide evidence artifact. Exits 0 if valid, 1 if invalid/tampered, 2 if malformed, and 3 if a required network step was unreachable.
mergeguide verify-evidence [OPTIONS] ARTIFACT
OptionDescription
--jsonEmit machine-readable JSON.
--skip-transparencySkip live transparency-log re-verification (air-gapped use only).
--rekor-url TEXTOverride the transparency-log base URL.
--public-key-source [bundle|endpoint]Where to source the public key (default bundle, fully offline).
--dashboard-url TEXTDashboard base URL, used with --public-key-source=endpoint.
--key-cache-dir DIRECTORYPublic-key cache directory.
--timeout FLOATPer-request timeout in seconds (default 8.0).

mergeguide auth

Authentication subcommands.
SubcommandDescription
auth loginAuthenticate with the dashboard.
auth whoamiShow the currently authenticated identity.
auth logoutClear local credentials.
mergeguide auth login --api-key mg_xxxxxxxxxxxxxxxx
mergeguide auth whoami
mergeguide auth logout

mergeguide config

Manage MergeGuide configuration.
SubcommandDescription
config listList current configuration.
config getGet a configuration value.
config setSet a configuration value.
config unsetRemove a configuration value.
config pathShow the configuration file path.
mergeguide config list
mergeguide config set org acme-corp
mergeguide config path

mergeguide hooks

Manage git hooks for local policy enforcement.
SubcommandDescription
hooks installInstall MergeGuide git hooks (single repo or fleet via --all).
hooks uninstallRemove MergeGuide git hooks.
hooks statusShow the status of installed hooks.
hooks check-commit-msgValidate a commit message file.
hooks bypassesShow the audit log of hook bypasses.
hooks install options:
OptionDescription
--forceOverwrite existing hooks.
--hook-type [all|pre-commit|pre-push|commit-msg|post-commit]Hook type to install.
--all DIRECTORYFleet install across every git repo under a root.
--dry-runWith --all, report what would be done without writing.
--max-depth INTEGERWith --all, max recursion depth (default 5).
mergeguide hooks install --hook-type pre-commit
mergeguide hooks status

mergeguide sbom

Generate a Software Bill of Materials from your dependency manifests.
SubcommandDescription
sbom generateGenerate an SBOM from manifest files.
sbom formatsList the supported SBOM output formats.
sbom generate options:
OptionDescription
-f, --format [cyclonedx-json|cyclonedx-xml|spdx-json|spdx-tag-value]Output format (default cyclonedx-json).
-o, --output PATHWrite to a file (default stdout).
-n, --name TEXTProject/component name.
--version TEXTProject/component version.
-d, --description TEXTProject description.
--include-devInclude dev dependencies.
mergeguide sbom generate . --format spdx-json -o sbom.json
mergeguide sbom formats

mergeguide scan

Run the specialized security scanners.
SubcommandDescription
scan vulnScan manifest files for known vulnerabilities (OSV).
scan iacScan infrastructure-as-code files for misconfigurations.
Both subcommands share these options:
OptionDescription
-p, --path PATHDirectory to scan (default current directory).
-f, --format [text|json|sarif]Output format (default text).
--fail-on [none|high|critical]Exit 1 at this severity or above (default none).
scan iac supports Terraform, CloudFormation, Kubernetes, and Helm.
mergeguide scan vuln --path ./my-project --fail-on critical
mergeguide scan iac main.tf --format sarif

Exit codes

CodeMeaning
0Success — no blocking findings.
1Policy violations found.
2Configuration or environment error.
verify-evidence and the scan subcommands use their own exit-code conventions — see each command above.