What do you want to do?
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.
- Pgbot
- Software and DevOps
- Intermediate
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.
- Pgbot
- Software and DevOps
- Intermediate
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.
- Pgbot
- Software and DevOps
- Intermediate
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.
- Pgbot
- Software and DevOps
- Advanced
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.
- Pgbot
- Claude Code
- Software and DevOps
- Intermediate
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.
How to use Pgbot
- 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.
- Open pgrundev/pgbot on GitHub and read the README and license.
- Install Pgbot with
curl -fsSL https://pgbot.dev/install | sh. - Generate the read-only role setup SQL with
pgbot init, review it, and run it yourself, since Pgbot executes nothing. (inferred, check the README) - Set the connection once with
export DATABASE_URL="postgres://pgbot_ro@host:5432/db". - Run
pgbot inspectfor 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.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeAbout 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 hot
- 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
Maintain Pgbot? Add the Featured on Deduped badge
Paste this into your README:
[](https://dedupedai.com/use-cases/pgrundev-pgbot/?ref=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.
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: Harness2, iFixAi, Orca, Diagram Design, AI Memory.
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.