pgcli
A command-line PostgreSQL client with auto-completion and syntax highlighting.
Tested on Linux
Use it
Linux x86_64
pickfit ran these steps on 20 Nov 2026 (yesterday)
You need first
- System packages:
postgres
start throwaway PostgreSQL
pickfit-services start postgresuv tool install pgcli
uv tool install pgcli
Check that it works
pgcli --versionThe output should contain “Version: 4.7.1”.
First thing to try
pgcli -l postgresql://pickfit@127.0.0.1:5432/pickfitIt didn’t install for me
What it does
- Auto-complete SQL keywords, tables and columnsTested
- Syntax highlighting of SQLTested
- Context-sensitive smart completionTested
- Run psql back-slash commandsTested
- Pretty-print tabular query resultsNot tested
More it can do, from its docs (19)
From the tool’s own documentation and help. pickfit didn’t test these one by one.
- Syntax highlighting using Pygments
- Pretty print tabular data
- Connect using a postgres URI
- Use psql environment variables for login PGHOST, PGPORT, PGUSER, PGPASSWORD and PGDATABASE
- Connect over SSL
- Use DSN aliases from config file
- List available databases
- Auto-switch to vertical output for wide results
- Warn before destructive queries
- Customize the prompt format
- Run inside IPython console
- Connect through an SSH tunnel
- Log queries and output to file
- Run a command and exit
- Execute commands from a file
- Check database connectivity
- Print rows only without headers
- Run SQL after connecting
- Set row limit prompt threshold
How far pickfit got
Linux x86_64
- Installs
- Starts
- 4 of 5 features work
- Works offline
Good for
- connect to a Postgres database and run SQL queries interactively
- connect to a Postgres database over SSL
- run pgcli queries from an IPython session
An alternative to psql.
How pickfit tested it
Each run starts from a clean machine and follows the steps above. How pickfit verifies
Linux x86_64
Its main function works
- Replayed from scratch
- Works offline
- Checked on 20 Nov 2026
- Version 4.7.1
Differences the test machine hit
- README: Features are shown in the interactive REPL (tab completion, highlighting)
In the test: No TTY in the box, so completion, highlighting and backslash commands were tested through pgcli's own Python classes (PGCompleter, PGExecute with pgspecial) using the uv tool venv's python, against the local Postgres
What pickfit could check
About 96% of what applies to this tool. Not checked doesn’t mean it fails: it is what pickfit’s test machines couldn’t do yet, and it lowers no score.
- CheckedInstall1 of 1 system it claims installed and checked
- PartlyFeatures4 of 5 features reached a verdict. Not covered: a reason pickfit hasn’t sorted yet
- CheckedKnown vulnerabilities14 of 14 packages checked against OSV.dev
- CheckedInstall docs
- CheckedProject activity4 of 4 GitHub signals read
Doesn’t apply to this kind of tool: service starts and answers, ease of use.