@clidey/whodb-cli

中文文档
0.138.0发布于 2026/10/28Apache-2.0零依赖构建来源已验证近 30 天下载 2009

WhoDB CLI - database management tool with TUI, programmatic commands, and MCP server

原始使用文档
文档目录14 节
  1. Installation
  2. Features
  3. Supported Databases
  4. Usage
  5. Interactive Mode (TUI)
  6. Programmatic Commands
  7. MCP Server Mode
  8. Database-only MCP Client Configuration
  9. Assistant Integration Installer
  10. Environment Variables
  11. Available MCP Tools
  12. Platform Support
  13. Links
  14. License

@clidey/whodb-cli

WhoDB CLI - a powerful database management tool with interactive TUI, programmatic commands, and MCP server for AI assistants.

Installing this package provides the whodb command. If you'd rather use a namespaced package name, install @clidey/whodb instead — both provide the same command.

Installation

# Run directly (no install required)
npx @clidey/whodb-cli --help

# Or install globally
npm install -g @clidey/whodb-cli

Both install methods provide the whodb command.

Features

  • Interactive TUI: Full terminal UI for database management
  • Programmatic Commands: Query, export, and manage databases from scripts
  • MCP Server: Integrate with Claude Desktop, Claude Code, and other MCP clients
  • Assistant Integrations: Install ready-to-use MCP configs for Codex, Claude Code, Cursor, VS Code, GitHub Copilot CLI, Gemini CLI, Windsurf, OpenCode, Cline, Zed, Continue, and aider

Supported Databases

  • PostgreSQL
  • MySQL / MariaDB
  • SQLite
  • MongoDB
  • Redis
  • Elasticsearch
  • ClickHouse

Usage

Interactive Mode (TUI)

npx @clidey/whodb --tui

Programmatic Commands

# Query a database
npx @clidey/whodb query "SELECT * FROM users LIMIT 10" --connection mydb

# List schemas
npx @clidey/whodb schemas --connection mydb --format json

# List tables
npx @clidey/whodb tables --connection mydb --schema public

# Describe columns
npx @clidey/whodb columns --connection mydb --table users

# Export data
npx @clidey/whodb export --connection mydb --table users --format csv --output users.csv

MCP Server Mode

Platform MCP is the default. Sign in to each host, then start the server:

npx @clidey/whodb login --host <url>
npx @clidey/whodb mcp serve

Use workspace: {host, org, project} on platform tool calls to target a specific workspace without changing saved defaults.

For database-only tools, enable the database module using npx @clidey/whodb setup. The server command stays the same:

npx @clidey/whodb mcp serve

Write operations require confirmation by default. Use --allow-write to disable confirmations or --read-only to block writes.

Restrict AI access to specific connections with --allowed-connections:

npx @clidey/whodb mcp serve --database --allowed-connections prod,staging

Database-only MCP Client Configuration

Example configuration (from whodb mcp serve --database --help):

{
  "mcpServers": {
    "whodb": {
      "command": "whodb",
      "args": ["mcp", "serve"],
      "env": {
        "WHODB_POSTGRES_1": "{\"alias\":\"prod\",\"host\":\"localhost\",\"user\":\"user\",\"password\":\"pass\",\"database\":\"db\"}"
      }
    }
  }
}

Assistant Integration Installer

Install native assistant configuration with the bundled CLI:

npx @clidey/whodb skills install --target cursor
npx @clidey/whodb skills install --target vscode
npx @clidey/whodb skills install --target gemini-cli
npx @clidey/whodb skills install --target claude-code --include-agents
npx @clidey/whodb skills install --target cursor --dry-run

Supported targets: codex, claude-code, cursor, vscode, github-copilot, gemini-cli, windsurf, opencode, cline, zed, continue, and aider.

Existing JSON and JSONC configuration files are merged in place and rewritten as formatted JSON. Before an existing JSON or YAML assistant config is rewritten, the original file is saved beside it as <filename>.whodb.bak. Use --dry-run to preview created or updated files and any backup paths without writing changes.

Environment Variables

Configure database connections via environment profiles, for example WHODB_POSTGRES='[{"alias":"prod","host":"localhost","user":"user","password":"pass","database":"db","port":"5432"}]' or WHODB_MYSQL_1='{"alias":"dev","host":"localhost","user":"user","password":"pass","database":"devdb","port":"3306"}'. Each object supports alias (connection name), host, user, password, database, port, and optional config.

VariableDescription
WHODB_<DBTYPE>JSON array of credential objects for a database type
WHODB_<DBTYPE>_NJSON object for a single credential (numbered profiles)

Use the alias field to set the connection name (e.g., prod). If omitted, the CLI assigns a name like postgres-1.

Available MCP Tools

ToolDescription
whodb_connectionsList available database connections
whodb_schemasList schemas in a database
whodb_tablesList tables in a schema
whodb_columnsGet column details for a table
whodb_queryExecute SQL queries
whodb_confirmConfirm pending write operations (only when confirm-writes is enabled)

Platform Support

This package automatically installs the correct binary for your platform:

  • macOS (Intel and Apple Silicon)
  • Linux (x64, ARM64, ARMv7)
  • Windows (x64, ARM64)

License

Apache-2.0

版本与发布记录

@clidey/whodb-cli 共发布 55 个版本,首次发布于 2025/12/30;过去 12 个月发布了 55 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.138.0latest2026/10/2813 天前
0.137.02026/10/2813 天前
0.136.02026/10/2119 天前
0.135.02026/10/1625 天前
0.134.02026/09/301 个月前
0.133.02026/09/301 个月前

关于 @clidey/whodb-cli 的常见问题

@clidey/whodb-cli 是什么?

WhoDB CLI - database management tool with TUI, programmatic commands, and MCP server

如何安装 @clidey/whodb-cli?

在项目目录运行 npm install @clidey/whodb-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 whodb、whodb-cli,可以用 npx whodb 直接运行。

@clidey/whodb-cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/clidey__whodb-cli 是否存在。

@clidey/whodb-cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=14。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@clidey/whodb-cli 可以商用吗?

@clidey/whodb-cli 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@clidey/whodb-cli 的下载量有多少?

根据 npm 官方下载统计,@clidey/whodb-cli 在 2026/10/10 – 2026/11/08 这 30 天内被下载 2,009 次,日均约 67 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@clidey/whodb-cli 还在维护吗?

最新版本 0.138.0 发布于 2026/10/28(13 天前);至今共发布 55 个版本,其中过去 12 个月发布了 55 个;首次发布于 2025/12/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。