# DBX Database CLI

Inspects DBX database connections and runs bounded read-only queries and schema docs.

- Repository: https://github.com/t8y2/dbx (28458 stars)
- Category: Data and ML
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add t8y2/dbx --skill dbx -g -a claude-code -y`
Codex: `npx skills add t8y2/dbx --skill dbx -g -a codex -y`
Cursor: `npx skills add t8y2/dbx --skill dbx -g -a cursor -y`
Gemini CLI: `npx skills add t8y2/dbx --skill dbx -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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](references/commands.md) for the complete command map and execution modes. Read [references/workflows.md](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](references/safety.md) before any write, DDL, production, or credential-related task.

## Execution Choice

The rest: https://github.com/t8y2/dbx/blob/HEAD/skills/dbx/SKILL.md
