Install, connect, and diagnose your PostgreSQL databases in under 5 seconds. No database modifications required.
pip install pgclaw# Interactive setup
pgclaw setup
# Or specify connection details directly
pgclaw setup --host db.example.com --port 5432 --user postgres --dbname mydbpgClaw stores connection details securely in your OS keychain. Passwords are never stored in plaintext config files.
pgclaw health-check --profile prod# Run as a background daemon
pgclaw monitor --profile prod --interval 30 --daemon &
# Or run interactively in the foreground
pgclaw monitor --profile prod --interval 30Run diagnostics from the command line
pgclaw health-check --profile prodComing Q3 2026. For now use the CLI or integrate via subprocess.
import subprocess
result = subprocess.run(
["pgclaw", "health-check", "--profile", "prod", "--output", "json"],
capture_output=True, text=True
)
findings = json.loads(result.stdout)Run continuous monitoring in the background
pgclaw monitor --profile prod --interval 30 --daemon &Expose pgClaw metrics for your existing monitoring
pgclaw exporter --port 9187 --profile prod --interval 30pgClaw supports 6 output formats. Use --output to switch between them.
# Terminal output (default) - colored, human-readable
pgclaw health-check --profile prod --output terminal
# JSON - for scripts and integrations
pgclaw health-check --profile prod --output json
# Markdown - for documentation and wikis
pgclaw health-check --profile prod --output markdown
# HTML - full report with styling, save and email
pgclaw health-check --profile prod --output html --save
pgclaw health-check --profile prod --output html --save --email team@company.com
# PDF - printable reports
pgclaw health-check --profile prod --output pdf --save
# Slack - formatted for Slack channels
pgclaw health-check --profile prod --output slack# Save an HTML report
pgclaw health-check --profile prod --output html --save
# Save and email to your team
pgclaw health-check --profile prod --output html --save --email team@company.com# List all saved reports
pgclaw reports list
# Compare two reports to see what changed
pgclaw reports compare report1.json report2.json# Review findings one-by-one, provide feedback
pgclaw health-check --profile prod --reviewInteractive review walks through each finding and lets you approve, dismiss, or provide feedback. Your feedback trains pgClaw to suppress noise over time.
# List suppressed findings
pgclaw suppressions list
# Remove a suppression by ID
pgclaw suppressions remove IDReject the same finding 3 times with the same reason and pgClaw auto-suppresses it. Your team knowledge becomes pgClaw's knowledge.
pgClaw operates at 5 autonomy levels. You control how much authority the agent has - from observe-only to full autonomous remediation.
Collect telemetry and report findings. No actions taken. Default for new installations.
Everything in Level 1, plus generate remediation plans with risk scores. Still no actions taken.
Everything in Level 2, plus execute approved remediations. Requires explicit DBA approval via Jira, Slack, or email before each action.
Automatically execute low-risk remediations (VACUUM, ANALYZE, kill idle sessions). Medium and high-risk actions still require approval.
Full autonomous operation. All remediations execute automatically. Destructive operations (DROP, REINDEX CONCURRENTLY on large tables) ALWAYS require human approval regardless of level.
When pgClaw recommends a remediation at autonomy Level 3+, it creates a ticket in Jira or sends a Slack message and waits for DBA approval. The approval workflow supports three responses:
APPROVED PROCEEDExecute the remediation immediately.
APPROVED 3/30 4am ESTSchedule execution for a specific maintenance window. pgClaw holds the action until the specified time.
REJECTEDDecline the remediation. pgClaw asks for a reason and stores it for future reference. Repeated rejections auto-suppress the finding.
Every action - approved, scheduled, or rejected - is logged in the encrypted audit trail with timestamp, initiator, and result.
pgclaw patroni status --profile prodpgclaw backup status --profile prod# Start the Slack bot with action buttons
pgclaw slack-bot startThe Slack bot posts findings with interactive action buttons. DBAs can approve, reject, or schedule remediations directly from Slack.
# Send report to your team via email
pgclaw health-check --profile prod --output html --save --email team@company.compgClaw supports managing multiple clusters from a single configuration file at ~/.pgclaw/config.yaml.
connections:
prod:
host: db-prod-1.example.com
port: 5432
dbname: myapp
user: pgclaw_monitor
sslmode: require
staging:
host: db-staging.example.com
port: 5432
dbname: myapp_staging
user: pgclaw_monitor
sslmode: requirePasswords are resolved through the secrets hierarchy: environment variables (PGCLAW_PROD_PRIMARY_PASSWORD), OS keychain, or .pgpass. Never store passwords in config files - pgClaw will raise a SecurityError.
pgClaw works standalone with 93 diagnostic rules. Connect to Sage for AI-powered correlation analysis, anomaly detection, and collective learning from your DBA team decisions. Available on Pro tier and above.
# Add to ~/.pgclaw/config.yaml
sage:
api_url: https://api.dbabrain.ai# Set your Sage API key
export PGCLAW_SAGE_API_KEY='your-api-key'
# Run health check - automatically uses Sage when configured
pgclaw health-check --profile prodSecurity Note
Credentials never leave your infrastructure. pgClaw sends only normalized numeric telemetry to Sage - no query text, no table names, no schema details.
Passwords resolved via environment variables or OS keychain. Never stored in plaintext. Config files scanned for secrets on load.
SSL/TLS required by default (sslmode=require). All Sage API connections enforced HTTPS. SSH host key verification enabled.
All queries in auditable .sql files. Parameterized queries via psycopg.sql.SQL. Table/index names validated against strict regex.
Every action logged with timestamp, action, target, initiator, and result. Append-only, encrypted with SQLCipher when available.
Sensitive files written with 0600 (owner read/write only). Config, audit DB, and feedback DB all protected.
Install pgClaw and run your first health check in under 5 seconds.