pg-cmd - Lightweight PostgreSQL TUI & CLI Tool

Powerful Text User Interface (TUI) for PostgreSQL database management - cross-platform, no PostgreSQL client installation required, intuitive command-line interaction with rich terminal-based UI.

Free Trial

See TUI/CLI in Action

Watch how easy it is to manage PostgreSQL databases with pg-cmd's interactive TUI and powerful CLI commands.
This demo shows data export, SQL execution, and TUI menu navigation in real-time.

Key Features of Our TUI/CLI Tool

Intuitive TUI Interface

User-friendly Text User Interface with interactive menus, real-time feedback, and syntax highlighting - combines the power of CLI with the usability of graphical interfaces.

No Installation Needed

Extract the zip file and use immediately. No PostgreSQL client, no DLL files, no system environment configuration required.

Cross-Platform Support

Works seamlessly on Windows, Linux and macOS. Same command syntax and TUI experience across all operating systems.

Full Data Operations

Supports data import (CSV/TSV/TXT/JSON), data export(CSV/TSV/TXT/JSON), SQL script execution, and database connection management via both CLI commands and TUI menus.

High Performance

Lightweight core with optimized data processing algorithms. Fast data import/export with minimal resource consumption in both CLI and TUI modes.

Secure Connection

Supports PostgreSQL SSL/TLS encryption and md5/scram-sha-256 authentication to protect your database connection in both interactive TUI and scripted CLI usage.

TUI/CLI Usage Examples

1. Launch Interactive TUI Mode

Start the Text User Interface for interactive database management:

pg-cmd
pg-cmd> connect postgres:password123@192.168.0.102:5432/testdb
pg-cmd> load table=media_messages 
      > datafile=f:\media_messages.txt 
      > filetype=txt 
      > delimiter=, 
      > quote=" 
      > header=y;

Features in TUI mode:

  • Interactive menu navigation with keyboard shortcuts (arrow keys, Enter, Esc)
  • Real-time SQL editor with syntax highlighting
  • Visual progress bars for data import/export operations
  • Searchable database object browser (tables, views, procedures)

2. Run via CLI (Non-Interactive)

Basic connection command with host, port, service name, username and password:

pg-cmd dsn="postgres:password123@192.168.0.102:5432/testdb" task=load table=media_messages datafile=f:\media_messages.txt delimiter=, quote=" header=y quit=y

3. Export Data to CSV (TUI/CLI)

Export data from employees table to CSV file with custom delimiter (works in both modes):

pg-cmd dsn="postgres:password123@192.168.0.102:5432/testdb" task=unload table=employees datafile=e:\temp\tables\emp_data.csv delimiter="," header=y quit=y

Learn:

Pricing & Editions

pg-cmd offers flexible licensing options for individuals and enterprises. All paid editions include full TUI/CLI functionality, ongoing updates and technical support.

Edition Price (USD) License Type Features
Free Trial $0 30-day trial Full TUI/CLI features, limited to 1000 rows per import/export
Full Edition $49.95 Single user Full TUI/CLI features, unlimited rows
Enterprise Edition
(Site License)
$800 Unlimited users Full TUI/CLI features, unlimited rows + priority support
Buy Now Download Trail

Frequently Asked Questions

What is the difference between TUI and CLI modes in pg-cmd?

CLI (Command Line Interface) mode is for scripted/automated usage with single commands, while TUI (Text User Interface) mode provides an interactive, menu-driven terminal interface with visual feedback, progress indicators, and keyboard navigation - ideal for ad-hoc database management tasks. You can switch between modes based on your workflow needs.

What PostgreSQL versions does pg-cmd support?

pg-cmd supports PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14, 15 and 16. Both TUI and CLI modes work with on-premises PostgreSQL databases, PostgreSQL Cloud, Amazon RDS for PostgreSQL, and Azure Database for PostgreSQL.

Do I need to install PostgreSQL Client on my machine?

No, you don't need to install any PostgreSQL Client software (psql, libpq). pg-cmd has a built-in lightweight PostgreSQL connectivity component that allows direct connection to PostgreSQL databases without additional client installation - this applies to both TUI and CLI modes.

Can I use TUI mode in remote terminal sessions (SSH)?

Yes, the TUI mode is fully compatible with remote terminal sessions (SSH, Telnet, etc.) on Linux/macOS and Windows Terminal. It works with all standard terminal emulators and supports ANSI escape codes for proper rendering of the text-based interface.

Is my database password secure when using pg-cmd?

Yes. pg-cmd does not store your database credentials. In TUI mode, passwords are masked (hidden) when entered, and you can use environment variables or encrypted configuration files to pass credentials in CLI mode. All database connections use PostgreSQL's native SSL/TLS encryption and support scram-sha-256 authentication when enabled on the server side.