CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

pulsarctl

$ pulsarctl 官方出品 中风险
StreamNative · 数据库与数据处理 · Apache-2.0 · macos / linux / windows

由 StreamNative 开发的 pulsarctl 是 Java 版 pulsar-admin 的高性能 Go 替代品,覆盖 Pulsar 租户、命名空间、Topic、Schema 与 Function 管理。pulsarctl topics stats 原生输出 JSON,list 命令支持 --output=json。

FCRS-1.0 综合评分
83 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install streamnative/streamnative/pulsarctl
CLI vs MCP 选型建议 优先选 CLI

pulsarctl 无需 JVM 冷启动即可亚秒级调用 Pulsar 管理与统计接口,适合本地脚本与 Agent。

Agent 友好度体检单

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

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

FCRS-1.0 六维评分拆解

Agent 友好度 21 / 25

Go 原生快启动,list 命令支持 --output=json,topics stats 原生返回 JSON,但少数旧子命令参数格式略有差异。

  • --output=json on resource listings and native JSON on topics stats
安全与权限边界 20 / 25

pulsarctl context 上下文隔离与 JWT/OAuth2 认证完善,但 topics delete、tenants delete 等破坏性命令缺少 --dry-run。

  • Named context switching in ~/.config/pulsar/config
  • No --dry-run on destructive admin calls
安装与运行摩擦 13 / 15

单一 Go 二进制,可通过 Homebrew tap 与 GitHub Releases 安装,无需部署 Java/JVM。

  • Avoids JVM dependency of bin/pulsar-admin
能力覆盖与边际价值 13 / 15

完整覆盖 Pulsar 管理 REST API(租户、命名空间、Topic、Function、Connector 与 Schema)。

  • Full Pulsar cluster and Function admin surface
维护与来源背书 8 / 10

由 StreamNative(streamnative/pulsarctl)维护,采用 Apache-2.0 协议。

  • Official streamnative/pulsarctl repository
文档与可验证性 8 / 10

StreamNative 官方文档与内置 --help 清晰完整。

  • Command docs at docs.streamnative.io

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

鉴权方式
本地配置文件 环境变量密钥 浏览器 OAuth
凭证存储位置

在 ~/.config/pulsar/config 保存命名上下文与 JWT/OAuth2/TLS 配置,也支持 --admin-service-url 与 --token 参数。

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

Apache-2.0 开源 CLI,完全免费。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# pulsarctl Agent Rules
- Pass `--output=json` on list commands and verify `pulsarctl context current` before writes.
- Never run `topics delete`, `namespaces delete`, or `topics unload` on production namespaces without explicit approval.

Agent 高频安全命令配方

只读查询(安全推荐)

以 JSON 列出命名空间下的 Topic
pulsarctl topics list public/default --output=json

以结构化 JSON 列出 public/default 命名空间内的全部 Topic。

查看 Topic 吞吐与消息积压统计
pulsarctl topics stats persistent://public/default/events

返回原生 JSON 统计数据,涵盖生产者、订阅者与消息积压量。

受控写入与预演

创建分区 Topic
pulsarctl topics create persistent://public/default/events 4

在指定命名空间内创建包含 4 个分区的 Pulsar Topic。

核心优势

  • + 彻底免去 Apache Pulsar 原生 pulsar-admin 的数秒级 JVM 启动开销。
  • + topics stats 原生输出详尽 JSON,list 命令支持 --output=json。
  • + 支持多上下文切换以及 JWT、OAuth2 与 mTLS 认证。

注意事项与踩坑点

  • ! 需预先配置上下文或传入 --admin-service-url;并非所有子命令都统一支持 -o json。
  • ! 管理面包含租户与命名空间删除等破坏性操作且无 --dry-run。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI