Skip to main content

pgxcli vs pgcli

pgcli is a mature PostgreSQL CLI developed over many years, which has set the standard for interactive PostgreSQL clients.

pgxcli takes the simpler approach, focusing on speed and minmal setup. It is a singe Go binary with fast startup and TOML configuration. If you need a lightweight, It may be good fit. for a more feature-rich, established experience, pgcli remains the benchmark.

Where pgxcli stands out:

Now

  • Single binary: No external runtime dependencies (like Python).
  • Performance: Fast startup and better overall performance.

Planned

  • Modern CLI Interface: Enhanced user experience.
  • Streaming query results: Better handling of large tables.
  • Browser-based Table view: View results via localhost.
  • Direct Table export: Export to SQL INSERT, CSV, MD tables, Excel, and HTML.

Which one should I use?

Right now, I would definitely choose pgcli. I think no explanation is needed.

That could change as pgxcli matures. I would really appreciate if you give pgxcli a try and share your feedback. If you want to contribute, that would be even better.


Feature Comparison Matrix

CategoryFeaturepgcli (Python)pgxcli (Go, v0.1.0)Status
TL;DROverallFeature-rich, matureFast, simple, single-binary-
SQL EditingMulti-line modeRoadmap v0.2.0
Vi/Emacs toggleOut of scope
CompletionKeyword completionStable
Schema-aware completionRoadmap v0.2.0
OutputPager supportStable
Table formattingStable
Colored output + themesStable
Syntax highlighting (rich)Stable
CommandsBackslash meta-commandsStable Expanding
Built-in commands (clear)Expanding
HistoryPersistent historyStable
History based completionRoadmap
ConnectionStandard flagsStable
DSN/URI supportStable
Environment variablesStable
SSH tunnelsRoadmap
SecurityKeyring integrationRoadmap
ExecutionMulti-statementStable
Explain modeRoadmap
Timing displayStable
ConfigAuto-created configStable
Config formatINITOMLDifferent approach
UIStatus toolbarDeferred

Legend: Available   Planned   Deferred   Out of scope


Tech Stack Comparison

CategoryPython dbcli/pgcliGo Balaji01-4D/pgxcli
LanguagePythonGo
Postgres Driverpsycopgjackc/pgx
CLI Frameworkclickspf13/cobra
Interactive Promptprompt-toolkitjedib0t/go-prompter
Configurationconfigobjspf13/viper
SQL ParsersqlparseCustom Splitter
Tabular Outputtabulateolekukonko/tablewriter
Testingpyteststretchr/testify

Note: The feature comparison above reflects our understanding at the time of writing. As pgcli is an actively maintained project, we recommend checking the official pgcli documentation for the most up-to-date information on its features.