CLI Reference
The MergeGuide CLI provides policy checking, management, and integration capabilities.Installation
Commands
mergeguide check
Analyze code changes against policies.
| Option | Description |
|---|---|
--staged | Check staged changes only (default) |
--all | Check all uncommitted changes |
--range <range> | Check specific commit range |
--format <fmt> | Output format: text, json, sarif |
--verbose | Show detailed violation info |
--strict | Exit 1 only on failures, not warnings |
--offline | Use cached policies (no network) |
mergeguide auth
Manage authentication.
mergeguide policies
Manage and inspect policies.
mergeguide config
Manage configuration.
mergeguide hooks
Manage Git hooks.
Configuration File
Create.mergeguide.yaml in your repository root:
Environment Variables
| Variable | Description |
|---|---|
MERGEGUIDE_API_KEY | API key for authentication |
MERGEGUIDE_ORG | Default organization ID |
MERGEGUIDE_API_URL | Custom API endpoint |
MERGEGUIDE_CONFIG | Path to config file |
MERGEGUIDE_OFFLINE | Enable offline mode |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success (all checks passed) |
| 1 | Failure (policy violations found) |
| 2 | Error (configuration/network issue) |