CLI 目录 横向对比 FCRS-1.0 标准 关于我们 /llms.txt

PingCAP TiUP

$ tiup 官方出品 高风险
PingCAP · 数据库与数据处理 · Apache-2.0 · macos / linux · 评测日期:

PingCAP tiup 是 TiDB 分布式数据库生态的官方 Apache-2.0 Go 命令行与组件管理器,可一键拉起本地测试集群(tiup playground)、编排多节点生产集群(tiup cluster 支持 --format json 展示)、管理 dumpling/br/pd-ctl 等生态工具,并内置官方 SKILL.md。

FCRS-1.0 综合评分
84 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
https://github.com/pingcap/tiup/releases
CLI vs MCP 选型建议 优先选 CLI

tiup 负责多组件下载、本地沙箱启动与基于 SSH 的集群拓扑运维,并自带 SKILL.md 指导,显著优于无状态 MCP 封装。

核心事实概览

命令名
$ tiup
FCRS-1.0 总分
84/100 (良好 (Good))
证据置信度
中置信度 (源码/文档)
CLI vs MCP 建议
优先选 CLI
评测日期

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
✓ 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 20 / 25

内置官方 SKILL.md(official_skill)并在 tiup cluster display 支持 --format json,但 tiup status 与 tiup list 仍输出文本表格。

  • tiup cluster display <name> --format json emits structured inventory JSON
  • Ships official SKILL.md in pingcap/tiup
安全与权限边界 19 / 25

提供 tiup cluster check 上线前预检,并在 destroy 等破坏性操作上默认要求二次确认(或显式 -y)。

  • Pre-flight tiup cluster check and confirmation prompts on destructive commands
安装与运行摩擦 13 / 15

轻量 Go 二进制引导器,通过官方安装脚本或 GitHub Releases 支持 Linux 与 macOS(Windows 需使用 WSL2)。

  • Lightweight Go bootstrapper managing versioned TiDB components on Linux/macOS
能力覆盖与边际价值 14 / 15

统一托管 TiDB 本地 playground、生产 cluster 运维、bench、dumpling 与 br 等全套工具。

  • Unified component manager for the entire TiDB toolchain
维护与来源背书 9 / 10

由 PingCAP 官方团队在 pingcap/tiup 仓库以 Apache-2.0 协议持续维护。

  • Official pingcap/tiup repo (Apache-2.0)
文档与可验证性 9 / 10

在 docs.pingcap.com 具备详尽的中英文文档、SKILL.md 以及按组件拆分的 --help。

  • Comprehensive docs at docs.pingcap.com and SKILL.md

安全边界、鉴权与放权指南

鉴权方式
本地配置文件
凭证存储位置

在 ~/.tiup/ 目录下保存组件元数据、SSH 密钥/拓扑配置以及本地运行实例状态。

潜在副作用
只读查询 本地写入 远端写入 破坏性删除
费用与配额提示

CLI 与 TiDB 社区版开源免费(Apache-2.0);运行集群需自备服务器与存储资源。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# TiUP Agent Rules
- Run `tiup cluster list` and `tiup cluster display <name> --format json` before mutating any cluster.
- Always run `tiup cluster check` prior to `tiup cluster deploy` or `scale-out`.
- Never execute `tiup cluster destroy` or `scale-in` without explicit human confirmation.

Agent 高频安全命令配方

只读查询(安全推荐)

列出已部署的 TiDB 集群
tiup cluster list

展示本地 ~/.tiup/storage/cluster/clusters/ 中记录的所有 TiDB 集群。

以 JSON 格式查看集群拓扑与节点状态
tiup cluster display prod-tidb --format json

以结构化 JSON 输出各节点角色、主机地址、端口与健康状态。

受控写入与预演

部署前执行集群环境预检
tiup cluster check ./topology.yaml --apply

在正式部署前校验操作系统内核参数、端口占用与 SSH 连通性。

核心优势

  • + 随附官方 SKILL.md,且 tiup cluster display 支持 --format json 结构化输出。
  • + 内置 tiup cluster check 预检,可在部署前拦截系统参数与网络异常。
  • + 一套命令同时覆盖本地 tiup playground 体验与生产级 tiup cluster 管理。

注意事项与踩坑点

  • ! tiup status 与 tiup list 尚未提供全局 --json 输出。
  • ! 仅原生支持 Linux 与 macOS,Windows 环境下需依赖 WSL2。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI

同分类相关 CLI: 数据库与数据处理

进入分类页 →
Skeema 84/100
$ skeema

面向 MySQL 与 MariaDB 的声明式纯 SQL Schema 管理工具,提供 `skeema diff` 预览与 `--allow-unsafe` 安全门控。

$ surreal

多模型数据库 SurrealDB 官方 CLI(`surreal`),支持 `--json` 查询、导入导出与本地嵌入式启动。

pgroll 84/100
$ pgroll

零停机扩展/收缩 PostgreSQL Schema 迁移工具,支持 `start`、`complete` 与即时 `rollback`。

$ bq

Google Cloud BigQuery 官方 CLI(`bq`),支持 `--format=json` 与 `--dry_run` 扫描字节预估。

jq 97/100
$ jq

必备 JSON 管道裁剪器,将冗长的 CLI/API 响应压缩为最小化的 Agent 友好字段。

$ duckdb

嵌入式 SQL 分析 CLI,直接对本地 CSV/Parquet/JSON 执行查询并支持 `-json` 与 `-readonly`。