Skip to content

Gemini CLI

Give Gemini CLI the Dungbeetle MCP tools so it can triage snapshot runs and — with your confirmation — approve baselines. You stay the account owner; Gemini holds only a scoped, revocable agent token.

1. Prerequisites

  • The Dungbeetle CLI: npm install -g dungbeetle.
  • Node.js with npx (the server is on npm as dungbeetle-mcp — see Setup).
  • A Dungbeetle cloud account with a repository (getting access).

2. Mint a token

sh
dungbeetle login --label "Gemini CLI"

Approve the printed code at /ui/connect in your browser, picking the repository Gemini may work with. See Agent authentication.

3. Configure MCP

Add an mcpServers block to ~/.gemini/settings.json (or the project's .gemini/settings.json — don't commit a real token):

json
{
  "mcpServers": {
    "dungbeetle": {
      "command": "npx",
      "args": ["-y", "dungbeetle-mcp"],
      "env": {
        "DUNGBEETLE_AGENT_TOKEN": "dbat_…"
      }
    }
  }
}

Self-hosting

Both commands default to the hosted cloud. On a self-hosted server, pass --server <url> to dungbeetle login and add "DUNGBEETLE_SERVER_URL": "https://your-server" to the env block above.

Check it registered with /mcp inside Gemini CLI. Optionally teach the loop in your project's GEMINI.md context file:

md
## Snapshot testing

After editing UI or output-producing code, run `dungbeetle test`. If it fails,
read the semantic diff with the dungbeetle MCP tools (`dungbeetle_list_runs`,
`dungbeetle_get_run`) before changing baselines; baseline approval requires
human confirmation.

4. First loop

Ask Gemini:

List the recent Dungbeetle runs and show me the semantic diff of the latest failed one.

Gemini calls dungbeetle_list_runs, then dungbeetle_get_run with detail: "full" — a compact node-level diff, never screenshots. Fix the regression (or decide the change is intended), then:

Approve that run and promote the new baselines.

dungbeetle_approve_run is marked destructive, so Gemini CLI asks for your confirmation before running it — approval stays human-owned.

Scopes

Use the Triage preset (runs:read baselines:read analytics:read reviews:write) — the default when dungbeetle login requests no explicit scopes. Gemini can read diffs and record your review decisions but can't push runs or rewrite baselines outside the promote-on-approve path. See scopes.

Source-available: CLI under FSL-1.1-ALv2, cloud server under BUSL-1.1. See Licensing.