DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to use Pgbot: what you can do with it

What is Pgbot? pgbot is a read-only Go command-line tool that reads PostgreSQL's own statistics views and prints a findings-first health report with changes since the last run.

How do I use it? Install Pgbot with curl -fsSL https://pgbot.dev/install | sh; then generate the read-only role setup SQL with pgbot init, review it, and run it yourself, since Pgbot executes nothing; set the connection once with export DATABASE_URL="postgres://pgbot_ro@host:5432/db". Full steps below.

Trended earlier

View repo on GitHub

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer

5 use cases

  • Triage a slow PostgreSQL database in ten seconds

    Run one read-only health check and get ranked findings for a database you do not own.

    View prompt
    Using the pgbot tool from the pgrundev/pgbot repository, run `pgbot inspect --json` against the database whose connection string is in <target-env-var>. Report the CRITICAL and WARNING findings and the health score. Verify that the JSON contract version reported is 1.5.0 before you trust the findings.
  • Find the queries that eat the most database time

    Rank statements by total time or call count to pick the first query to tune.

    View prompt
    Use the pgbot tool from the pgrundev/pgbot repository to run `pgbot queries --json` against <target-db-url>. Return the top five statements by total time with their share and call count. Verify that the response has enabled true and available true before you report an empty list as a real empty workload.
  • Spot unused indexes and likely missing indexes

    Find zero-scan indexes and large tables with heavy sequential scans before dropping or adding anything.

    View prompt
    Use the pgbot tool from the pgrundev/pgbot repository to run `pgbot indexes --json` and `pgbot tables --json` against <target-db-url>. List the zero-scan indexes with their sizes and the large tables with heavy sequential scans. Verify that you do not recommend dropping any index while replication is active without stating the per-node scan caveat.
  • Gate schema migrations in CI with a Postgres lint

    Fail a pull request when a schema change adds a critical finding, without a live production database.

    View prompt
    Use the pgbot tool from the pgrundev/pgbot repository in CI by running `pgbot inspect --profile=schema --fail-on=critical --format=sarif` against <ci-database-url>. Report the exit code and the number of findings in the SARIF output. Verify that exit code 3 is reported as a connection failure rather than as a finding.
  • Let Claude Code read PostgreSQL findings over MCP

    Connect an AI coding agent to structured database findings through the Pgbot MCP server.

    View prompt
    Using the pgrundev/pgbot MCP server running against <target-db-url>, fetch the current health findings and list each CRITICAL and WARNING finding with the table, query, or index it names. Verify that the response includes the contract version 1.5.0 before you act on any finding.

Quick start with Pgbot

  1. Check you have what it needs: A PostgreSQL server version 14 to 18 that you can reach over the network; A login role with the pg_monitor role and no write grants (pgbot init generates the setup SQL); The pgbot binary, installed with the curl install script or npx @pgbot/cli.
  2. Open pgrundev/pgbot on GitHub and read the README and license.
  3. Install Pgbot with curl -fsSL https://pgbot.dev/install | sh.
  4. Generate the read-only role setup SQL with pgbot init, review it, and run it yourself, since Pgbot executes nothing. (inferred, check the README)
  5. Set the connection once with export DATABASE_URL="postgres://pgbot_ro@host:5432/db".
  6. Run pgbot inspect for the graded summary.

These steps come from our top use case, Triage a slow PostgreSQL database in ten seconds, which also has a copy-paste agent prompt.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for pgrundev/pgbot

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Best AI repos for Software and DevOps

About this repo

  • Who it is forDatabase engineers, DevOps staff, and AI agents that need structured PostgreSQL health findings without deploying a monitoring stack.
  • Why it is hot1.5k stars, launched 90 days ago
  • LanguageGo
  • Sourcegithub.com/pgrundev/pgbot · Back to Hot repos

Requirements

  • A PostgreSQL server version 14 to 18 that you can reach over the network
  • A login role with the pg_monitor role and no write grants (pgbot init generates the setup SQL)
  • The pgbot binary, installed with the curl install script or npx @pgbot/cli
  • Optional: pg_stat_statements for the queries section, and hypopg on PostgreSQL 16+ for advise

Add this badge to your README

Maintain Pgbot? Show readers where to find these use cases. Use cases on Deduped

Markdown

[![Use cases on Deduped](https://dedupedai.com/badge/pgrundev/pgbot.svg)](https://dedupedai.com/use-cases/pgrundev-pgbot/?utm_source=github&utm_medium=badge&utm_campaign=pgrundev-pgbot)

HTML

<a href="https://dedupedai.com/use-cases/pgrundev-pgbot/?utm_source=github&amp;utm_medium=badge&amp;utm_campaign=pgrundev-pgbot"><img src="https://dedupedai.com/badge/pgrundev/pgbot.svg" alt="Use cases on Deduped" height="20"></a>

A static image, no tracking script. About the badge

Questions about Pgbot

What is Pgbot?

pgbot is a read-only Go command-line tool that reads PostgreSQL's own statistics views and prints a findings-first health report with changes since the last run. It is an open-source project on GitHub: https://github.com/pgrundev/pgbot.

How do I use Pgbot?

Install Pgbot with curl -fsSL https://pgbot.dev/install | sh; then generate the read-only role setup SQL with pgbot init, review it, and run it yourself, since Pgbot executes nothing; set the connection once with export DATABASE_URL="postgres://pgbot_ro@host:5432/db". The use cases on this page give the full steps and a copy-paste agent prompt for each job.

Who is Pgbot for?

Database engineers, DevOps staff, and AI agents that need structured PostgreSQL health findings without deploying a monitoring stack.

What can I do with Pgbot?

5 use cases so far, for example: Triage a slow PostgreSQL database in ten seconds; Find the queries that eat the most database time; Spot unused indexes and likely missing indexes. Each has steps and a copy-paste agent prompt.

What do I need to run Pgbot?

A PostgreSQL server version 14 to 18 that you can reach over the network; A login role with the pg_monitor role and no write grants (pgbot init generates the setup SQL); The pgbot binary, installed with the curl install script or npx @pgbot/cli; Optional: pg_stat_statements for the queries section, and hypopg on PostgreSQL 16+ for advise.

What are alternatives to Pgbot?

Other hot AI repos in Software and DevOps: Skills, Claude Mem, Freellmapi, Andrej Karpathy Skills, Agent Desktop.

Is Pgbot safe to run?

Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.