psqlc - PostgreSQL Management CLI Tool

PyPI version Python versions License

psqlc is a production-ready, feature-rich command-line interface tool for managing PostgreSQL databases with beautiful output formatting and intelligent auto-detection capabilities.

psqlc screenshot

Features

Key Features:

  • 🚀 Async Operations - Built on asyncpg for high-performance database operations

  • 🎨 Beautiful Output - Rich-formatted tables and colored output for better readability

  • 🔍 Auto-Detection - Intelligently detects Django settings and configuration files

  • 🛡️ Production-Ready - Comprehensive error handling and safe operations

  • 📊 Comprehensive Management - Full database, table, user, and query management

  • 🔒 Security-First - Password prompts and confirmation for destructive operations

  • 🌐 Multi-Format Config - Supports .env, .json, .yaml, and settings.py files

Quick Start

Installation

Install psqlc using pip:

pip install psqlc

Requirements

  • Python 3.6+

  • PostgreSQL database server

  • Required packages: rich, asyncpg, licface, envdot, pwinput

Basic Usage

Show all databases:

psqlc show dbs -U postgres -P yourpassword

Create user and database:

psqlc create myuser mypassword mydb -U postgres -P adminpass

Show tables in database:

psqlc show tables -d mydb

Execute query:

psqlc query -d mydb -q "SELECT * FROM users LIMIT 10"

Table of Contents

Additional Information

Indices and tables

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Hadi Cahyadi