pgcli is an interactive command-line interface and database management tool for PostgreSQL. It functions as an interactive SQL shell and query editor that allows users to inspect schemas, manage connections, and run queries against PostgreSQL data sources.
The tool is distinguished by its real-time, schema-aware autocompletion for keywords, tables, and columns, as well as dynamic SQL syntax highlighting. It provides safety mechanisms through transaction-aware guardrails that warn against or block destructive statements when no active transaction is detected.
Broad capabilities include secure database connectivity via URIs, DSNs, and SSH tunneling, along with a customizable terminal interface supporting Vi keybindings and external editor integration. The system also handles data visualization through result-set paging and multiple formatting modes, while offering utilities for SQL data export and periodic query execution.