dbgorilla-cli

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: MIT

README

dbgorilla

test lint CodeQL release Go version

The DBGorilla CLI. Sign in to a DBGorilla deployment and connect your IDE/agent (Claude Code, Cursor, VS Code, opencode, Gemini CLI) via MCP in three commands.

Install

Homebrew
brew install dbgorilla/tap/dbgorilla
dbgorilla --api-url https://<your-deployment> login

Installs the dbgorilla binary with a dbg alias — use whichever you prefer.

The first dbgorilla login persists the API URL (and --insecure if you pass it) to ~/.config/dbgorilla/cli.toml (or $XDG_CONFIG_HOME/dbgorilla/cli.toml), so every subsequent command runs without flags.

Go install
go install github.com/dbgorilla/dbgorilla-cli/cmd/dbgorilla@latest

Produces the dbgorilla binary (symlink it to dbg yourself if you want the short name). Requires a release cut with the cmd/dbgorilla layout.

Manual

Download a binary from the Releases page and put it on your PATH.

Quick start

dbgorilla login          # sign in (browser-based SSO or username/password)
dbgorilla setup-ide      # configure every detected MCP client (Claude Code, Cursor, VS Code, ...)
dbgorilla doctor         # verify everything works

That's it. Restart your IDE/agent and DBGorilla is wired up.

Supported MCP clients

dbgorilla setup-ide auto-detects every supported client installed on your machine and configures each one. Pass --client <slug> to target a specific tool, or --list-clients to see what's supported and which are detected.

Client Slug Setup type Notes
Claude Code claude-code writer Prefers claude mcp add; falls back to direct file write
Cursor cursor writer ~/.cursor/mcp.json (user) or .cursor/mcp.json (project)
VS Code vscode writer .vscode/mcp.json (project) by default
opencode opencode writer ~/.config/opencode/opencode.json (user)
Gemini CLI gemini writer ~/.gemini/settings.json (user)
Claude Desktop claude-desktop manual hint Remote HTTP MCP requires Settings → Connectors UI flow

Useful flags:

dbg setup-ide --list-clients              # what's supported, what's detected
dbg setup-ide --client cursor             # target one
dbg setup-ide --client cursor,vscode      # target several
dbg setup-ide --scope project             # override the per-client default scope
dbg setup-ide --dry-run                   # show what would be written
dbg setup-ide --print-config --client X   # print the entry to paste manually

The merge is safe: existing MCP servers and unrelated config keys are preserved, every write is preceded by a <path>.backup.<timestamp>, and JSONC files (with // comments) are refused rather than overwritten.

Commands

Command What it does
dbg login Sign in. Auto-detects SSO vs. username/password.
dbg logout Clear stored credentials.
dbg whoami Show the signed-in user and organization.
dbg setup-ide Mint an MCP API key and register DBGorilla in every detected MCP client. See Supported MCP clients.
dbg doctor Verify auth, API reachability, MCP key, and per-client config.
dbg config set <key> <value> Set api-url or insecure in user config.
dbg config get <key> Show the resolved value and where it came from.
dbg config unset <key> Clear a key from the user config.
dbg version Print version info.

Centralized Claude allowlist

If your org uses a managed Claude allowlist (Team / Enterprise tier on app.claude.com), dbg setup-ide may be blocked by policy. Run:

dbg setup-ide --print-admin-allowlist

...and send the output to whoever manages your Claude admin console. Once they allowlist dbg, re-run dbg setup-ide.

Configuration

Two persisted settings: api-url and insecure. Both follow the same priority chain (highest first):

  1. Command-line flag (--api-url, --insecure / --insecure=false)
  2. Environment variable (DBGORILLA_API_URL; there is no DBGORILLA_INSECURE env var — persist via dbg config set insecure true or pass --insecure on each call)
  3. $XDG_CONFIG_HOME/dbgorilla/cli.toml (per-user; defaults to ~/.config/dbgorilla/cli.toml; written by dbg login and dbg config set)
  4. /etc/dbgorilla/cli.toml (or /Library/Application Support/dbgorilla/cli.toml on macOS, C:\ProgramData\dbgorilla\cli.toml on Windows) — IT-deployed via MDM, read-only from the CLI

If nothing is configured, dbgorilla exits with an actionable error pointing at the layers above.

dbg config get <key> shows which layer won the lookup.

Persisted on successful login

dbg login writes both api-url (always) and insecure (when --insecure was explicitly passed) into the user config. This is the "I logged in once with the flags, now everything just works" pattern. Saved values are visible in ~/.config/dbgorilla/cli.toml.

Overriding persisted state
  • --api-url https://other — one-shot override; doesn't change config.
  • --insecure=false on dbg login — turns off any persisted insecure = true.
  • dbg config unset insecure — clears insecure without re-logging in.

Compatibility

Requires a DBGorilla deployment that exposes the Keycloak device-flow auth-config endpoint and the MCP API-key endpoints. If you're unsure whether your deployment qualifies, contact your DBGorilla administrator.

Building from source

For contributors:

git clone https://github.com/dbgorilla/dbgorilla-cli.git
cd dbgorilla-cli
go build -o dbgorilla ./cmd/dbgorilla

Requires the Go version declared in go.mod (see the badge at the top of this README for the live value). Released binaries are produced from this same source by goreleaser on every v*.*.* tag — the ./dbgorilla you build locally behaves identically.

Cross-compile for another platform:

GOOS=darwin GOARCH=arm64 go build -o dbg-darwin-arm64 ./cmd/dbgorilla
GOOS=darwin GOARCH=amd64 go build -o dbg-darwin-amd64 ./cmd/dbgorilla
GOOS=linux  GOARCH=amd64 go build -o dbg-linux-amd64 ./cmd/dbgorilla
GOOS=linux  GOARCH=arm64 go build -o dbg-linux-arm64 ./cmd/dbgorilla

Feedback

Open an issue for bug reports or feature requests. Please include the output of dbg doctor (redacting any sensitive values) and your platform.

License

MIT

Directories

Path Synopsis
cmd
dbgorilla command
internal
api
Package api wraps HTTP calls to the DBGorilla backend.
Package api wraps HTTP calls to the DBGorilla backend.
auth
Device flow (RFC 8628) login against Keycloak via the DBGorilla backend.
Device flow (RFC 8628) login against Keycloak via the DBGorilla backend.
collector
Package collector renders the external dbg-collector's config, manages its Docker lifecycle, and persists local state so `dbg collector` can install, inspect, and remove a collector that monitors a developer's local Postgres.
Package collector renders the external dbg-collector's config, manages its Docker lifecycle, and persists local state so `dbg collector` can install, inspect, and remove a collector that monitors a developer's local Postgres.
config
Package config persists non-secret CLI configuration and resolves the API URL via a deterministic layered priority chain.
Package config persists non-secret CLI configuration and resolves the API URL via a deterministic layered priority chain.
ide
Package ide provides detection and configuration for IDE/agent MCP integrations.
Package ide provides detection and configuration for IDE/agent MCP integrations.
preflight
Package preflight runs read-only checks against a PostgreSQL instance to answer: "is this database ready to be a DBGorilla collector source?"
Package preflight runs read-only checks against a PostgreSQL instance to answer: "is this database ready to be a DBGorilla collector source?"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL