dbx
できること
DBXコマンドラインツールを使い、AIエージェントがデータベースのスキーマを確認したり、安全な読み取り専用のクエリを実行したり、スキーマのドキュメントを生成したりできるようにします。DBXをすでに使っていて、エージェントに安全にデータベースを扱わせたい人向けです。
使う場面
- ✓エージェントにデータベースのスキーマを調べさせたり、データから質問に答えさせたりしたいとき。
- ✓データベースからドキュメントやDBMLの図を生成したいとき。
- ✓テーブルをDBX Desktopで開いて確認したいとき。
スキルのリンク
https://github.com/t8y2/dbx/blob/main/skills/dbx/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“売上データベースを見て、先月の注文数を読み取り専用のクエリで教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントはDBXの接続一覧を取得し、スキーマを確認して、DBXツールを通じて上限付きの読み取り専用クエリを実行します。書き込みは、正確に何を行うかを明示的に承認しない限りブロックされます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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
- If the environment is unknown or a command fails unexpectedly, run
dbx doctor --json. - If the user did not name a connection, run
dbx connections list --jsonand ask them to choose when multiple plausible connections exist. - Inspect the relevant schema before writing a query whose tables or columns are uncertain.
- Prefer
--jsonfor machine-readable results. - Keep exploratory queries bounded with
--limit 50 --timeout 10sunless 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-writesunless the user explicitly approves the exact write operation. - Never add
--allow-dangerous-sqlunless 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 listintentionally 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 --jsoncan execute directly. - Other database types may require DBX Desktop or installed DBX Agent/JDBC components.
dbx openalways requires DBX Desktop.- When
DBX_WEB_URLis 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: rundbx 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.
よくある質問
エージェントはデータを変更できますか?
標準ではできません。クエリは読み取り専用で、書き込みは正確な操作ごとに明示的な承認が必要です。
接続のパスワードは表示されますか?
いいえ。接続の一覧には機密情報が含まれません。
複数の接続が当てはまる場合は?
エージェントはどの接続を使うかを選ぶよう求めます。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 29k
- ランキング
- #9792
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
似ているスキル
discrawl
394k保存済みのローカルなDiscordメッセージのアーカイブを検索して要約し、その新しさを確認し、ダイレクトメッセージを読めるようエージェントを支援します。
clickhouse-io
280kエージェントがClickHouseデータベースのクエリとスキーマを最適化できるようにします。高性能な分析処理向けのベストプラクティスを適用します。分析クエリが遅すぎるときに使います。
scientific-db-pubmed-database
280kエージェントが生物医学分野の科学論文を検索するのに役立ちます。特定の医療情報が必要な研究に便利です。