pulsarctl
$ pulsarctl 官方出品 中风险由 StreamNative 开发的 pulsarctl 是 Java 版 pulsar-admin 的高性能 Go 替代品,覆盖 Pulsar 租户、命名空间、Topic、Schema 与 Function 管理。pulsarctl topics stats 原生输出 JSON,list 命令支持 --output=json。
brew install streamnative/streamnative/pulsarctl pulsarctl 无需 JVM 冷启动即可亚秒级调用 Pulsar 管理与统计接口,适合本地脚本与 Agent。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
Go 原生快启动,list 命令支持 --output=json,topics stats 原生返回 JSON,但少数旧子命令参数格式略有差异。
--output=jsonon resource listings and native JSON ontopics stats
pulsarctl context 上下文隔离与 JWT/OAuth2 认证完善,但 topics delete、tenants delete 等破坏性命令缺少 --dry-run。
- Named context switching in
~/.config/pulsar/config - No
--dry-runon destructive admin calls
单一 Go 二进制,可通过 Homebrew tap 与 GitHub Releases 安装,无需部署 Java/JVM。
- Avoids JVM dependency of
bin/pulsar-admin
完整覆盖 Pulsar 管理 REST API(租户、命名空间、Topic、Function、Connector 与 Schema)。
- Full Pulsar cluster and Function admin surface
由 StreamNative(streamnative/pulsarctl)维护,采用 Apache-2.0 协议。
- Official
streamnative/pulsarctlrepository
StreamNative 官方文档与内置 --help 清晰完整。
- Command docs at docs.streamnative.io
安全边界、鉴权与放权指南
在 ~/.config/pulsar/config 保存命名上下文与 JWT/OAuth2/TLS 配置,也支持 --admin-service-url 与 --token 参数。
Apache-2.0 开源 CLI,完全免费。
# 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 高频安全命令配方
只读查询(安全推荐)
pulsarctl topics list public/default --output=json
以结构化 JSON 列出 public/default 命名空间内的全部 Topic。
pulsarctl topics stats persistent://public/default/events
返回原生 JSON 统计数据,涵盖生产者、订阅者与消息积压量。
受控写入与预演
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。