{
  "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": [],
    "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
    },
    "source": [
      {
        "id": "help",
        "kind": "help",
        "url": "https://github.com/edenhill/kcat/blob/master/kcat.c",
        "revision": "master 2026-10-27",
        "evidence": "Mode:\n  -P                 Producer\n  -C                 Consumer\n  -L                 Metadata List\nGeneral options for most modes:\n  -t <topic>         Topic to consume from, produce to, or list\n  -p <partition>     Partition\n  -b <brokers,..>    Bootstrap broker(s) (host[:port])\n  -K <delim>         Key delimiter (same format as -D)\n  -c <cnt>           Limit message count\n  -F <config-file>   Read configuration properties from file,\n  -q                 Be quiet (verbosity set to 0)\n  -v                 Increase verbosity\nProducer options:\n  -z snappy|gzip|lz4 Message compression. Default: none\n  -k <str>           Use a fixed key for all messages.\n  -H <header=value>  Add Message Headers (may be specified multiple times)\n  -l                 Send messages from a file separated by\n  file1 file2..      Read messages from files.\nConsumer options:\n  -o <offset>        Offset to start consuming from:\n                     beginning | end | stored |\n  -e                 Exit successfully when last message received\n  -J                 Output with JSON envelope\n  -O                 Print message offset using -K delimiter\n  -u                 Unbuffered output\n"
      }
    ],
    "field": [
      {
        "id": "producer",
        "label": "Producer mode",
        "type": "boolean",
        "option": [
          "-P"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "consumer",
        "label": "Consumer mode",
        "type": "boolean",
        "option": [
          "-C"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "metadata",
        "label": "List metadata",
        "type": "boolean",
        "option": [
          "-L"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "brokers",
        "label": "Brokers",
        "description": "Comma-separated host[:port] list.",
        "type": "string",
        "option": [
          "-b"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "topic",
        "label": "Topic",
        "type": "string",
        "option": [
          "-t"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "partition",
        "label": "Partition",
        "type": "integer",
        "option": [
          "-p"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "offset",
        "label": "Start offset",
        "type": "string",
        "option": [
          "-o"
        ],
        "suggestions": [
          {
            "value": "beginning",
            "label": "Beginning"
          },
          {
            "value": "end",
            "label": "End"
          },
          {
            "value": "stored",
            "label": "Stored"
          }
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "count",
        "label": "Message count limit",
        "type": "integer",
        "option": [
          "-c"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "exit_at_end",
        "label": "Exit at last message",
        "type": "boolean",
        "option": [
          "-e"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "json",
        "label": "JSON envelope output",
        "type": "boolean",
        "option": [
          "-J"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "key",
        "label": "Fixed message key",
        "type": "string",
        "option": [
          "-k"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "key_delim",
        "label": "Key delimiter",
        "type": "string",
        "option": [
          "-K"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "config_file",
        "label": "Config file",
        "type": "path",
        "option": [
          "-F"
        ],
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "help"
        ]
      },
      {
        "id": "verbose",
        "label": "Verbosity",
        "type": "count",
        "option": [
          "-v"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "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"
        ]
      }
    ],
    "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"
        ]
      },
      {
        "id": "produce",
        "label": "Produce messages",
        "set": {
          "producer": [
            true
          ]
        },
        "lock": [
          "producer"
        ],
        "fields": [
          "producer",
          "brokers",
          "topic",
          "partition",
          "key",
          "key_delim",
          "config_file",
          "files"
        ],
        "required": [
          "brokers",
          "topic"
        ]
      },
      {
        "id": "list",
        "label": "List cluster metadata",
        "set": {
          "metadata": [
            true
          ]
        },
        "lock": [
          "metadata"
        ],
        "fields": [
          "metadata",
          "brokers",
          "topic",
          "config_file"
        ],
        "required": [
          "brokers"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "producer",
          "consumer",
          "metadata",
          "brokers",
          "topic",
          "offset",
          "count"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "partition",
          "exit_at_end",
          "json",
          "key",
          "key_delim",
          "config_file",
          "verbose",
          "files"
        ]
      }
    ]
  }
}
