kaf is a robust, terminal-based Kafka client built for speed, safety, and modern data architectures. Unlike other tools, it's designed to be Production-Safe by default, preventing accidental data loss while providing deep insights into your clusters.
- 🛡️ Safe by Default: Starts in Read-Only mode. Destructive actions require an explicit
--writeflag. - 📦 Data-Aware: Native support for Avro and Protobuf decoding via Confluent Schema Registry.
- 📂 Local Protobuf Support: Decode raw messages without a registry by pointing to your local
.protofiles. - 🏷️ Header Visibility: View Kafka Headers at a glance for tracing and metadata debug.
- 🕵️ Sensitive Data Masking: Automatically redact keys like
passwordortokenfrom displayed JSON. - 🧠 Smart Memory Management: Automatic buffer capping (100MB) and UI virtualization. It won't crash your server.
- 🕵️ Real-time Insights: View consumer group lag and status.
- 🚀 Zero-Config: Interactive setup wizard or environment variables support.
Download the latest binary for your platform from the Releases page.
go install github.com/goiriz/kaf/cmd/kaf@latestmake static
sudo cp kaf /usr/local/bin/Run the interactive setup wizard:
kaf setupLaunch with a specific broker:
kaf --broker localhost:9092Or use environment variables:
export KAFKA_BROKERS="prod-1:9092,prod-2:9092"
kafkaf provides two ways to decode Protobuf messages without a Schema Registry:
If you provide proto_paths, kaf will scan all .proto files and attempt to decode incoming messages by matching them against all known message types. This is great for exploration.
To prevent incorrect guesses or to explicitly enforce a schema for a topic, use topic_proto_mappings in your config:
topic_proto_mappings:
"orders-topic": "com.example.Order"
"users": "User"In Strict Mode, if a message fails to decode as the mapped type, kaf will display a (Decode Error) and show the raw hex.
While viewing a topic, press v to cycle through decoders:
- AUTO (PROTO/AVRO): Uses Registry, Mappings, or Guessing.
- TEXT/JSON: Forces plain-text or pretty-printed JSON view.
- HEX: Shows the raw binary data.
kaf remembers your decoder choice per topic for the duration of the session.
| Key | Action |
|---|---|
g |
Switch between Topics and Groups modes |
C |
(Shift+C) Switch Cluster Context |
tab |
Change focus between Sidebar and Details |
c |
Tail mode (Real-time stream) |
b |
History mode (Load last 1000 messages) |
y |
Copy message to clipboard |
v |
Cycle decoder (Auto/JSON -> Hex) |
? |
Show help menu |
esc |
Go back or Quit |
- Anti-OOM Protection: Message buffer is capped at 100MB by default.
- Controller Protection: Metadata requests have a 3s timeout to prevent DoS on large clusters.
- Secure Secrets: Supports
password_cmdin configuration to fetch credentials from external vaults (e.g.,pass,aws-cli).
contexts:
local:
brokers: ["localhost:9092"]
prod:
brokers: ["kafka-prod:9092"]
tls: true
proto_paths: ["./protos", "/home/user/my-app/api"]
sasl:
mechanism: "SCRAM-SHA-512"
username: "admin"
password_cmd: "pass kafka/prod-password"
schema_registry_url: "http://schema-registry:8081"
log_path: "/tmp/kaf.log"
log_max_size_mb: 10