pgcli

Execute SQL queries against PostgreSQL databases and return JSON results.

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/pramudityad/pi-config --skill pgcli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pgcli
Source: https://github.com/pramudityad/pi-config/tree/main/skills/pi-skills/pgcli
Command: npx skills add https://github.com/pramudityad/pi-config --skill pgcli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pg, and includes scripts (resource) components.

What problem does it solve?

This Skill simplifies interacting with PostgreSQL databases, allowing users to query data, explore schemas, and troubleshoot issues without needing deep SQL expertise.

Core Features & Use Cases

  • Database Querying: Execute SQL queries and retrieve results in a structured JSON format.
  • Schema Exploration: Easily list tables, view column details, and identify indexes within a database schema.
  • Use Case: A developer needs to quickly check the contents of a users table in a staging database. They can use this skill to list tables, describe the users table, and then query for specific records.

Quick Start

Use the pgcli skill to list all tables in the public schema of the default database.

Frequently Asked Questions about pgcli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I execute SQL queries against a PostgreSQL database and get JSON output?

You can execute SQL queries against a PostgreSQL database using this command-line interface, which returns the retrieved results in a structured, parseable JSON format for easy data manipulation.

What is the best way to explore a PostgreSQL database schema from the command line?

To explore a PostgreSQL schema, you can use this interface to easily list tables, view specific column details, and identify indexes within your database without needing deep SQL expertise.

Does this PostgreSQL command-line tool prevent accidental data modifications?

Yes, this PostgreSQL command-line tool ensures safe operations by defaulting to a read-only mode, which prevents accidental data modifications while you query and explore your database.

Can I manage multiple PostgreSQL connection profiles for different environments?

Yes, you can manage connection profiles to streamline interacting with PostgreSQL databases across different environments, allowing you to quickly switch contexts and troubleshoot staging or production issues.

How do I quickly check the contents of a specific table in a PostgreSQL database?

You can list tables in the public schema, describe the target table to view its columns, and then execute targeted SQL queries to retrieve specific records from the PostgreSQL database.