id = "kcat"
name = "kcat"
homepage = "https://github.com/edenhill/kcat"
description = "A command-line utility for producing and consuming Kafka messages."
executables = ["kcat", "kafkacat"]
[dotfiles]
paths = ["~/.config/kcat.conf", "~/.config/kafkacat.conf"]
secret = []
[[dotfiles.secret_paths]]
file = ["~/.config/kcat.conf", "~/.config/kafkacat.conf"]
match = { prefix = ["sasl.password", "ssl.key.password"] }
[commands]
format = 1
label = "Produce, consume or list Kafka"
description = "Pick a mode (producer, consumer or metadata list), then set brokers and topic. Consumer groups (-G), query mode, serializers, formatting strings and -X properties are left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = false, short_attached = true, short_bundles = false }
[[commands.source]]
id = "help"
kind = "help"
url = "https://github.com/edenhill/kcat/blob/master/kcat.c"
revision = "master 2026-10-27"
evidence = """
Mode:
-P Producer
-C Consumer
-L Metadata List
General options for most modes:
-t <topic> Topic to consume from, produce to, or list
-p <partition> Partition
-b <brokers,..> Bootstrap broker(s) (host[:port])
-K <delim> Key delimiter (same format as -D)
-c <cnt> Limit message count
-F <config-file> Read configuration properties from file,
-q Be quiet (verbosity set to 0)
-v Increase verbosity
Producer options:
-z snappy|gzip|lz4 Message compression. Default: none
-k <str> Use a fixed key for all messages.
-H <header=value> Add Message Headers (may be specified multiple times)
-l Send messages from a file separated by
file1 file2.. Read messages from files.
Consumer options:
-o <offset> Offset to start consuming from:
beginning | end | stored |
-e Exit successfully when last message received
-J Output with JSON envelope
-O Print message offset using -K delimiter
-u Unbuffered output
"""
[[commands.field]]
id = "producer"
label = "Producer mode"
type = "boolean"
option = ["-P"]
sources = ["help"]
[[commands.field]]
id = "consumer"
label = "Consumer mode"
type = "boolean"
option = ["-C"]
sources = ["help"]
[[commands.field]]
id = "metadata"
label = "List metadata"
type = "boolean"
option = ["-L"]
sources = ["help"]
[[commands.field]]
id = "brokers"
label = "Brokers"
description = "Comma-separated host[:port] list."
type = "string"
option = ["-b"]
sources = ["help"]
[[commands.field]]
id = "topic"
label = "Topic"
type = "string"
option = ["-t"]
sources = ["help"]
[[commands.field]]
id = "partition"
label = "Partition"
type = "integer"
option = ["-p"]
sources = ["help"]
[[commands.field]]
id = "offset"
label = "Start offset"
type = "string"
option = ["-o"]
suggestions = [{ value = "beginning", label = "Beginning" }, { value = "end", label = "End" }, { value = "stored", label = "Stored" }]
sources = ["help"]
[[commands.field]]
id = "count"
label = "Message count limit"
type = "integer"
option = ["-c"]
sources = ["help"]
[[commands.field]]
id = "exit_at_end"
label = "Exit at last message"
type = "boolean"
option = ["-e"]
sources = ["help"]
[[commands.field]]
id = "json"
label = "JSON envelope output"
type = "boolean"
option = ["-J"]
sources = ["help"]
[[commands.field]]
id = "key"
label = "Fixed message key"
type = "string"
option = ["-k"]
sources = ["help"]
[[commands.field]]
id = "key_delim"
label = "Key delimiter"
type = "string"
option = ["-K"]
sources = ["help"]
[[commands.field]]
id = "config_file"
label = "Config file"
type = "path"
option = ["-F"]
path = { kind = "file", role = "input", must_exist = true }
sources = ["help"]
[[commands.field]]
id = "verbose"
label = "Verbosity"
type = "count"
option = ["-v"]
sources = ["help"]
[[commands.field]]
id = "files"
label = "Input files"
description = "Producer mode: files to send instead of stdin."
type = "path"
position = 0
multiple = true
path = { kind = "file", role = "input", must_exist = true }
sources = ["help"]
[[commands.task]]
id = "consume"
label = "Consume a topic"
set = { consumer = [true], offset = ["beginning"], exit_at_end = [true] }
lock = ["consumer"]
fields = ["consumer", "brokers", "topic", "partition", "offset", "count", "exit_at_end", "json", "key_delim", "config_file"]
required = ["brokers", "topic"]
[[commands.task]]
id = "produce"
label = "Produce messages"
set = { producer = [true] }
lock = ["producer"]
fields = ["producer", "brokers", "topic", "partition", "key", "key_delim", "config_file", "files"]
required = ["brokers", "topic"]
[[commands.task]]
id = "list"
label = "List cluster metadata"
set = { metadata = [true] }
lock = ["metadata"]
fields = ["metadata", "brokers", "topic", "config_file"]
required = ["brokers"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["producer", "consumer", "metadata", "brokers", "topic", "offset", "count"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["partition", "exit_at_end", "json", "key", "key_delim", "config_file", "verbose", "files"]