About Pgcli
Pgcli is a command-line interface for PostgreSQL databases written in Python. It is an interactive terminal client that suggests completions for SQL keywords, tables and columns as you type and colors queries with syntax highlighting, which makes ad hoc querying faster than with a plain prompt.
It is licensed under the BSD 3-Clause licence and installed on your own machine as a Python package, with no server component to host. It is aimed at developers and database administrators who spend time in the terminal running queries against local or remote Postgres instances.
Key features
- Autocompletion for SQL keywords, tables and columns
- Syntax highlighting in the terminal
- Interactive command-line client for PostgreSQL
- Installs as a Python package
Good fit for
- Running ad hoc queries against Postgres
- Exploring database schemas from the terminal
Pgcli: questions and answers
- What is Pgcli used for?
- Pgcli is a command-line client for PostgreSQL that adds autocompletion and syntax highlighting to the interactive terminal experience. It is a good fit for running ad hoc queries against Postgres and exploring database schemas from the terminal.
- Is Pgcli open source?
- Yes. Pgcli is open source under the BSD-3-Clause licence. Its source code is on GitHub at dbcli/pgcli and is written mainly in Python.
- Is Pgcli free?
- Yes. Pgcli is open source, so the software itself is free to use.
- What are some alternatives to Pgcli?
- Similar open-source tools in the Database Tools category include Mycli, Harlequin and Goose. SaaS products in the same category include Mochi Table, AI2sql and Aqua Data Studio.
- Is Pgcli actively maintained?
- Yes. The most recent commit to Pgcli was on 4 November 2026, and the latest release is v4.7.1, published on 20 September 2026. The project has 13k stars on GitHub, with 31 added in the last 30 days.
Open-source alternatives to Pgcli
See all
Mycli
Database Tools
Rich MySQL Terminal Client with AutoCompletion, Syntax Highlighting, and Dataframes
BSD-3-Clause★ 12k
Harlequin
Database Tools
The SQL IDE for Your Terminal. Now with hsql, your agent's favorite sql client.
MITvs DataGrip★ 6.5k
Goose
Database Tools
A database migration tool. Supports SQL migrations and Go functions.
OSS★ 12kAdminer
Database Tools
Database management in a single PHP file
OSSvs DataGrip★ 8k
pgBackRest
Database Tools
Reliable PostgreSQL Backup & Restore
OSS★ 4.5k
pgAdmin
Database Tools
pgAdmin is the most popular and feature rich Open Source administration and development pl
OSSvs Navicat★ 3.9k
SaaS alternatives to Pgcli
See all
Mochi Table
Database Tools
Local tables for customer lists or trackers that you manage from the CLI alongside Claude, Codex and OpenCode
SaaS
AI2sql
Database Tools
Turns plain-English requests into SQL for your schema, and fixes or explains existing queries
SaaS
Aqua Data Studio
Database Tools
Cross-database IDE with query, visual analytics and data modeling features
SaaS
DBCode
Database Tools
VS Code extension for browsing and querying databases
SaaS
dbForge Studio
Database Tools
Devart IDE suite for developing and managing MySQL, SQL Server, Oracle and PostgreSQL
SaaS
DesignSQL
Database Tools
Workspace that keeps code, drag-and-drop tables and diagrams of a database schema in sync
SaaS

