finds.dev

dbcli/pgcli

Postgres CLI with autocompletion and syntax highlighting

View on GitHubHomepage ↗

★ 13,216PythonBSD-3-Clauseupdated Jun 2026

// the take

pgcli is a terminal client for Postgres that replaces psql with context-aware autocompletion and syntax highlighting. It knows the difference between `SELECT * FROM <tab>` (show tables) and `WHERE <tab>` (show columns), which sounds obvious but psql has never bothered. For anyone who spends real time in a Postgres shell, this is the first thing you should install.

Smart completion is genuinely useful — it queries your actual schema and distinguishes context so completions are relevant, not just keyword dumps. The IPython integration is a real feature: drop into a pgcli session mid-notebook, run a query, exit, and the results are in your workspace. Destructive query warnings (`--warn all`) catch `DELETE FROM users` without a WHERE before you hit Enter. Maintained actively — last push was 10 days ago, CI/CD is set up properly, and it has real behavioral test coverage using Behave feature files against a live database.

Startup time is noticeably slower than psql because it has to introspect the schema on connect — on databases with hundreds of tables and schemas this gets annoying fast. The `\` backslash command support is described as 'primitive' in the README and that's accurate: you'll hit gaps if you rely heavily on psql meta-commands. No support for multiple simultaneous connections or session switching — you get one connection per process. Configuration lives in a hand-edited rc file with no documentation beyond the comments in the file itself; anything non-obvious requires reading source.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
13,216
Forks
598
Language
Python
License
BSD-3-Clause
Last commit
3 Jun 2026

// nearby

If pgcli isn't quite it.

All repos →