Redpanda CLI (rpk)
$ rpk Official Med Riskrpk is Redpanda's all-in-one CLI compatible with both Redpanda and Apache Kafka clusters. It manages topics, consumer groups, ACLs, Schema Registry, and Connect pipelines, offering structured --format json / -f json output and stdin/stdout JSON message streaming.
brew install redpanda-data/tap/redpanda rpk streams topic records directly through shell pipes (rpk topic consume -f '%v\n' -n 10 | jq) and works against any Kafka/Redpanda cluster.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Broad --format json support across cluster info, topic list, topic consume, and group describe, plus --num bounded reads.
- Supports
--format json/-f jsonacross admin and consume commands --num <N>preventstopic consumefrom hanging in non-TTY shells
Profile isolation and SASL/TLS support are solid, though destructive commands (topic delete, group offset-delete) lack --dry-run.
- Named profiles in
rpk.yamlisolate clusters - No global
--dry-runontopic deleteor ACL deletions
Single binary distributed via Homebrew tap and official zip archives for macOS and Linux (Windows via WSL/binary).
- Standalone binary via
brew install redpanda-data/tap/redpanda
Replaces fragmented kafka-topics.sh, kafka-console-consumer.sh, and Schema Registry curl scripts with one fast binary.
- Covers brokers, topics, ACLs, groups, and Schema Registry
First-party Redpanda Data CLI (redpanda-data/redpanda) with rapid release cadence.
- Official Redpanda Data repository
Comprehensive CLI reference at docs.redpanda.com with detailed --format template docs.
- Full
rpkcommand reference at docs.redpanda.com
Security, Auth & Guardrails
Stores broker profiles and SASL/TLS settings in ~/.config/rpk/rpk.yaml, or accepts --brokers, RPK_BROKERS, and --user/--password flags.
BSL-1.1 source-available (converts to Apache-2.0 after 4 years); free to use as a CLI client.
# Redpanda CLI (rpk) Agent Rules - Always pass `--format json` on `cluster`, `topic list`, and `group` read commands. - ALWAYS bound `rpk topic consume` with `--num <N>` or `--offset end` so the command exits instead of hanging. - Never run `rpk topic delete` or `rpk group delete` without explicit user confirmation.
Agent-Ready Command Recipes
Safe Read-Only Queries
rpk cluster info --format json
Returns structured JSON covering cluster ID, brokers, and topic summaries.
rpk topic consume orders --num 10 --format json
Reads exactly 10 messages (--num 10) as JSON and exits cleanly instead of tailing indefinitely.
Controlled Writes & Previews
echo '{"id":1,"status":"ok"}' | rpk topic produce orders Publishes one newline-delimited record from stdin to the orders topic.
Strengths for Agents
- +
--format jsonworks across cluster, topic, ACL, and consumer commands. - +
rpk topic consume --num <N>makes message sampling deterministic and non-blocking. - + Works with standard Apache Kafka brokers as well as Redpanda.
Caveats & Pitfalls
- ! Core repo uses BSL-1.1 source-available license (converts to Apache-2.0 after 4 years).
- ! Running
rpk topic consumewithout--numtails indefinitely and will hang an agent tool call.