dbcli
Read-only Postgres exploration and querying with enforced row caps and statement timeouts.
Free
Works with the AI Agents you already use
dbcli
Example session with this skill installed
Use dbcli to check the structure of the 'users' table in the 'public' schema and show me 3 sample rows.
- Read your context and instructions
- Compiled the dbcli
I have inspected the `users` table structure and retrieved a sample of the data using `dbcli`. ## Table Inspection: public.users **Table Structure** | Column | Type | Nullable | Constraints | | :--- | :--- | :--- | :--- | | id | uuid | NO | PRIMARY KEY | | email | varchar(255) | NO | UNIQUE | | created_at | timestamptz | NO | DEFAULT now() | | last_login | timestamptz | YES | - | | metadata | jsonb | YES | - | **Data Sample** | id | email | created_at | last_login | | :--- | :--- | :--- | :--- | | 550e8400-e29b... | dev@example.com | 2023-10-01T10:00:00Z | 2024-05-20T14:22:01Z | | 6ba7b810-9dad... | ops@example.com | 2023-11-15T08:30:00Z | 2024-05-19T09:15:30Z | | 7c9e6679-7425... | test@example.com | 2024-01-05T12:00:00Z | null | **Next steps** 1. Run a filtered query if you need to find specific user records. 2. Check `dbcli describe users` to see indexes and foreign key references to other tables. 3. Use `dbcli schemas` if you need to explore tables outside the `public` schema.
Connects securely to your tools. The creator never sees your data.
About this skill
Manual SQL exploration often leads to accidental data mutation or performance-draining queries that lock production tables. This skill provides a safe, read-only interface for inspecting Postgres databases using `dbcli`. It enforces strict boundaries on row counts and execution time, ensuring your agent can explore schemas and verify data without risking database integrity. ## What it does - **Schema discovery** lists all non-system schemas to understand high-level database organization. - **Table inspection** retrieves table lists within specific schemas and describes columns, indexes, and constraints. - **Data sampling** pulls real row examples from tables to verify column types and content patterns. - **Safe querying** executes arbitrary SQL inside read-only transactions with hard row caps and statement timeouts. - **Connection management** handles database profiles securely via stdin to prevent credential leakage in shell history. ## How it works 1. **Environment check** involves running `dbcli version` and assisting with installation via Go or prebuilt binaries if missing. 2. **Authorized discovery** uses the `schemas` and `schema` commands to map the database structure before writing queries. 3. **Deep inspection** utilizes `describe` to view indexes, enum values, and foreign key references for specific tables. 4. **Execution** runs the `query` command, parsing the resulting JSON envelope for data or structured error codes. ## Frameworks & tools This skill requires the `dbcli` binary. It interfaces with Postgres databases and can identify local instances via `docker ps` or `pg_isready`. ## Why this beats prompting it yourself Writing raw SQL through an agent often results in syntax errors on complex types or accidental `UPDATE` attempts. This skill uses a specialized CLI that pre-validates SQL, enforces a `READ ONLY` transaction state, and returns structured JSON that is easier for LLMs to parse than messy ASCII tables. ## Use cases - Auditing database schemas to generate documentation or ERDs. - Sampling production data safely to troubleshoot application-level bugs. - Running analytical read-only queries without risking table locks. - Onboarding agents to unfamiliar databases through systematic discovery steps. ## Known limitations Does not support write operations like `INSERT`, `UPDATE`, or `DELETE`. Queries are subject to a default 5-second timeout and a 500-row cap to prevent resource exhaustion.
Read-only access only. Hard row cap (500 default) and 5s statement timeout. Requires dbcli binary installation. Supports Postgres only.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 3 days ago
- Free with an Agensi account