CLI Reference: mergen-server
One binary operates the local runtime, the policy gate, and every recovery path. Commands below are grouped the way you'll actually reach for them: get running, operate day-to-day, manage policy, configure, and, once you're past day one, report and audit.
The primary binary is mergen; mergen-server remains a compatibility alias.
Run mergen help, mergen help --all, or mergen help <command>.
Get started
| Command | What it does |
|---|---|
mergen-server |
Zero-config demo: blocks a real destructive command, no account needed |
mergen-server setup |
Installs Mergen, configures your detected AI IDE, and starts the local runtime. No questions asked. |
mergen setup --terminal |
Terminal-only setup. Does not read or modify IDE configuration; use mergen run -- <command> to gate commands explicitly. |
mergen-server setup --full |
The same, plus guided Slack, PagerDuty, GitHub, and git-hook connection |
mergen-server setup --ide cursor |
Configure one specific IDE (cursor | vscode | claude-code | windsurf) |
mergen-server start |
Starts the local runtime (production mode) |
mergen-server stop |
Stops this workspace's running server; also the sanctioned recovery command if the gate is ever wedged |
mergen-server service install |
Supervises the server with your OS (launchd/systemd): starts at login, restarts on crash |
mergen-server login |
Authenticates the CLI: only needed for cloud/team features |
mergen-server dashboard |
Opens My Machine in your browser: this machine's gate activity across every connected IDE |
mergen-server governance |
Opens My Organization on mergen.app: org-wide policies, members, and billing (human-only; no agent can reach this) |
Operate & recover
These work even when the gate itself is unreachable: they're recognized directly by the Claude Code hook without a network round-trip.
| Command | What it does |
|---|---|
mergen-server status |
Live snapshot: server health, buffer size, errors, gate activity |
mergen doctor |
Core health check: runtime, policy, local protection, and orphaned processes |
mergen doctor --integrations |
Also validate optional external integrations |
mergen-server doctor --fix |
Repairs what it finds: prunes stale records, kills confirmed orphans, repairs the hook, starts a clean instance |
mergen-server doctor --security |
Hardening posture checklist: what an agent with filesystem access could forge on this install, and how to close it |
mergen-server approve <token> |
Approves a held tool call by token (honored once, for 10 minutes) |
mergen approvals |
Lists and resolves pending approvals owned by the current workspace |
mergen-server approve --last |
Approves the most recent pending hold, no token to copy |
mergen-server trust-reset |
Resets this session's scrutiny-tier reputation to normal, if every command is suddenly being held |
mergen-server panic on --minutes 15 --reason "..." |
Operator escape hatch: passes everything unenforced for a bounded window (max 4h), fully audited |
mergen-server exec -- <cmd> |
Runs a command through the full gate, then executes it: the explicit entrypoint for anything outside an IDE |
mergen run -- <cmd> |
Preferred terminal workflow; alias of exec |
mergen check -- <cmd> |
Evaluate a terminal command without executing it |
mergen events [--follow] |
Unified recent/live enforcement stream |
mergen-server gate-check -- <cmd> |
Evaluates only, no execution; this is what the Claude Code PreToolUse hook calls |
Policy
| Command | What it does |
|---|---|
mergen-server policies |
Lists active rules with action and trigger counts |
mergen-server promote |
Promotes the observation-window findings into active enforcement |
mergen-server policy-push |
Saves the live server's policy to .mergen/policy.json, for git |
mergen-server policy-pull |
Applies .mergen/policy.json to the live server |
mergen-server policy-diff |
Shows what would change between the file and the live server |
mergen-server policy-simulate <file> |
Replays a candidate policy against historical traffic: see what would newly block or hold |
mergen-server policy-test [file.json] |
Runs {input, expectedVerdict} test cases, no server required, CI-usable |
mergen-server policy-versions |
Lists restorable full-policy snapshots |
mergen-server policy-rollback <id> |
Restores a prior snapshot (immutable rules always survive) |
mergen-server scan <url> |
Scans an MCP server for injection vectors and risk signals before you connect it |
mergen-server test-safety |
Runs the adversarial bypass test suite against your live gate |
See Policies for the rule format and condition fields.
Configure
| Command | What it does |
|---|---|
mergen-server config |
Inspects every effective setting: value, source, and any ACTIVE settings that weaken enforcement |
mergen-server config set K V |
Writes an org-policy setting to the signed config file (guarded keys need --acknowledge-risk) |
mergen-server config modules |
Shows the core/module/integration manifest with live enabled state |
mergen-server config profile team |
Materializes a whole policy profile at once (solo | team | enterprise | fintech) |
mergen-server connect <name> |
Guided integration setup: slack | pagerduty | github | datadog | jira | linear | email | sync-plane |
mergen-server agent-register <id> |
Issues a signed identity token for an agent profile |
mergen-server agent-list |
Lists issued agent identity tokens on this machine |
mergen-server test |
Validates the installation end-to-end |
mergen-server test hitl |
End-to-end HITL check: synthetic hold → Slack delivery → approve round trip |
mergen-server ci |
CI smoke test (exit 0 = healthy) |
mergen-server --version |
Shows version |
mergen completion <bash|zsh|fish> |
Prints a shell-completion script for the consolidated command tree |
Full environment-variable reference (151 settings, generated, always current): Configuration Reference.
Reporting & insights
| Command | What it does |
|---|---|
mergen-server impact-report |
Prints the board-deck metrics: autonomous resolution rate, MTTR, blocks prevented |
mergen-server export-risk-report |
Prints a CISO-facing security risk report |
mergen-server verify-log |
Verifies the Agent Blunder Log's hash chain (tamper-evident audit) |
mergen-server trace-replay <traceId> |
Reconstructs the full gate-event + blunder-log timeline for one cross-process trace |
Run mergen-server help for the complete list, including advanced commands
(watch, explain, guard, backfill, pr) used less often day-to-day.