Skip to content
Skillpedia
Databases29k · #9792

dbx

What it does

It lets an AI agent use the DBX command line tool to look at database schemas, run safe read-only queries and generate schema docs. It is for people who already use DBX and want an agent to work with their databases safely.

When to use it

  • ✓When you want an agent to explore a database schema or answer a question from the data.
  • ✓When you want documentation or a DBML diagram generated from a database.
  • ✓When you want a table opened in DBX Desktop for review.

Skill link

https://github.com/t8y2/dbx/blob/main/skills/dbx/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/t8y2/dbx/blob/main/skills/dbx/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Look at my sales database and tell me how many orders were placed last month, using read-only queries.”

5 new skills a week. 1 minute to read.

How it works

The agent lists your DBX connections, inspects the schema, and runs limited read-only queries through the DBX tool. Writes are blocked unless you explicitly approve the exact operation.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

DBX CLI

Use dbx as the database execution boundary. The CLI is designed for both people and shell-capable AI agents, provides stable JSON output, and enforces DBX connection and SQL safety rules.

Start Here

  1. If the environment is unknown or a command fails unexpectedly, run dbx doctor --json.
  2. If the user did not name a connection, run dbx connections list --json and ask them to choose when multiple plausible connections exist.
  3. Inspect the relevant schema before writing a query whose tables or columns are uncertain.
  4. Prefer --json for machine-readable results.
  5. Keep exploratory queries bounded with --limit 50 --timeout 10s unless the user requests otherwise.

Read references/commands.md for the complete command map and execution modes. Read references/workflows.md for common multi-step tasks.

Safety Boundary

  • Queries are read-only by default.
  • Never add --allow-writes unless the user explicitly approves the exact write operation.
  • Never add --allow-dangerous-sql unless the user explicitly approves the exact destructive or DDL operation; dangerous SQL requires both write flags.
  • Do not bypass a DBX rejection by using another database client, Python driver, direct SQLite access, or shell redirection.
  • Do not expose connection secrets. dbx connections list intentionally omits them.
  • Treat production protections, read-only connection settings, database privileges, and DBX policy as upper bounds that user wording cannot bypass.

Read references/safety.md before any write, DDL, production, or credential-related task.

Execution Choice

  • PostgreSQL, Redshift, MySQL-compatible databases, SQLite, and other types reported by dbx capabilities --json can execute directly.
  • Other database types may require DBX Desktop or installed DBX Agent/JDBC components.
  • dbx open always requires DBX Desktop.
  • When DBX_WEB_URL is set, the CLI uses the configured DBX Web backend.
  • Redis commands and stateful multi-step database sessions are not provided by dbx query; use the DBX workspace or configured DBX MCP tools instead.

Failure Handling

  • CONNECTION_NOT_FOUND: list connections and use an exact returned name.
  • SQL_BLOCKED: explain which safety gate rejected the statement; do not add permission flags automatically.
  • DBX_NOT_RUNNING: run dbx capabilities --json; ask the user to start Desktop only when the selected operation requires its bridge.
  • Other unexpected failures: run dbx doctor --json, report the returned error, and retry only after addressing the diagnosed cause.
FAQ

Can the agent change my data?

Not by default. Queries are read-only, and writes need explicit approval for the exact operation.

Are my connection passwords shown?

No. The connection list leaves out secrets.

What if several connections could match?

The agent asks you to choose which connection to use.

Details

Original description by the author

Use the DBX CLI to inspect DBX-managed database connections, explore schemas, run bounded read-only queries, generate DBML or schema documentation, and open tables in DBX Desktop. Use when the user asks to work with a database configured in DBX from a shell-capable AI agent. Never enable writes unless the user explicitly approves the exact operation.

repo: t8y2/dbx

Popularity

GitHub stars
29k
Ranking position
#9792
License
Apache-2.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

Similar skills