Agent Skills › t8y2/dbx › dbx

dbx

GitHub

DBX CLI技能,用于安全地管理数据库连接、探索Schema及执行只读查询。提供JSON输出,严格限制写入操作以保障数据安全,支持多种数据库类型并具备完善的故障处理机制。

skills/dbx/SKILL.md t8y2/dbx

触发场景

用户需要查看或列出数据库连接 用户要求探索数据库结构或Schema 用户请求在受控环境下运行只读SQL查询

安装

npx skills add t8y2/dbx --skill dbx -g -y
更多选项

不安装直接使用

npx skills use t8y2/dbx@dbx

指定 Agent (Claude Code)

npx skills add t8y2/dbx --skill dbx -a claude-code -g -y

安装 repo 全部 skill

npx skills add t8y2/dbx --all -g -y

预览 repo 内 skill

npx skills add t8y2/dbx --list

SKILL.md

Frontmatter
{
    "name": "dbx",
    "version": "1.1.0",
    "metadata": {
        "cliHelp": "dbx --help",
        "requires": {
            "bins": [
                "dbx"
            ]
        }
    },
    "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."
}

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.

版本历史

  • 0fd1d61 当前 2026-09-27 21:37

    重构技能描述,明确 AI Agent 使用边界与安全规则,移除旧版前置条件与资源关系图,增强命令执行与故障处理指引。

  • 46db5f2 2026-07-24 17:33

元信息

文件数
0
版本
b47dc5a
Hash
8cd6264d
收录时间
2026-07-24 17:33

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-19 03:38
浙ICP备14020137号-1