MCPcopy Index your code
hub / github.com/birdayz/kaf

github.com/birdayz/kaf @v0.2.14 sqlite

repository ↗ · DeepWiki ↗ · release v0.2.14 ↗
160 symbols 390 edges 27 files 23 documented · 14%
README

Kaf

Kafka CLI inspired by kubectl & docker

Actions Status GoReportCard GoDoc AUR version

asciicinema

Install

Install via Go from source:

go install github.com/birdayz/kaf/cmd/kaf@latest

Install via install script:

curl https://raw.githubusercontent.com/birdayz/kaf/master/godownloader.sh | BINDIR=$HOME/bin bash

Install on Archlinux via AUR:

yay -S kaf-bin

Install via Homebrew:

brew tap birdayz/kaf
brew install kaf

Usage

Show the tool version

kaf --version

Add a local Kafka with no auth

kaf config add-cluster local -b localhost:9092

Select cluster from dropdown list

kaf config select-cluster

Describe and List nodes

kaf node ls

List topics, partitions and replicas

kaf topics

Describe a given topic called mqtt.messages.incoming

kaf topic describe mqtt.messages.incoming

Group Inspection

List consumer groups

kaf groups

Describe a given consumer group called dispatcher

kaf group describe dispatcher

Write message into given topic from stdin

echo test | kaf produce mqtt.messages.incoming

echo {"data":1} | kaf produce mqtt.messages.incoming --key 1 --header h1:hv1
> Sent record to partition 0 at offset 0.

kaf consume mqtt.messages.incoming --output json-each-row
> {"topic":"mqtt.messages.incoming","partition":0,"offset":0,"timestamp":"2025-07-04T12:53:46.841+02:00","headers":[{"key":"h1","value":"hv1"}],"key":"1","payload":"{data:1}"}


echo '{"topic":"mqtt.messages.incoming","partition":0,"offset":0,"timestamp":"2025-07-04T12:53:46.841+02:00","headers":[{"key":"h1","value":"hv1"}],"key":"1","payload":"{data:1}"}' | kaf produce mqtt.messages.incoming --input json-each-row

kaf consume mqtt.messages.incoming --output json-each-row
> {"topic":"mqtt.messages.incoming","partition":0,"offset":1,"timestamp":"2025-07-04T13:05:57.9+02:00","headers":[{"key":"h1","value":"hv1"}],"key":"1","payload":"{data:1}"}

Pipe from one topic to another kaf consume topic-a --output json-each-row -f | kaf produce topic-b --input json-each-row

Important: kaf produce will overwrite key, partition and all the headers and of input messages if provided

Consume messages with filtering by header kaf consume mqtt.messages.incoming --header h1:hv1

Offset Reset

Set offset for consumer group dispatcher consuming from topic mqtt.messages.incoming to latest for all partitions

kaf group commit dispatcher -t mqtt.messages.incoming --offset latest --all-partitions

Set offset to oldest

kaf group commit dispatcher -t mqtt.messages.incoming --offset oldest --all-partitions

Set offset to 1001 for partition 0

kaf group commit dispatcher -t mqtt.messages.incoming --offset 1001 --partition 0

Configuration

See the examples folder

Shell autocompletion

Source the completion script in your shell commands file:

Bash Linux:

kaf completion bash > /etc/bash_completion.d/kaf

Bash MacOS:

kaf completion bash > /usr/local/etc/bash_completion.d/kaf

Zsh

kaf completion zsh > "${fpath[1]}/_kaf"

Fish

kaf completion fish > ~/.config/fish/completions/kaf.fish

Powershell

Invoke-Expression (@(kaf completion powershell) -replace " ''\)$"," ' ')" -join "`n")

Sponsors

Redpanda

  • The streaming data platform for developers
  • Single binary w/no dependencies
  • Fully Kafka API compatible
  • 10x lower P99 latencies, 6x faster transactions
  • Zero data loss by default

Zerodha

Extension points exported contracts — how you extend this code

PacketDecoder (Interface)
(no doc) [1 implementers]
pkg/streams/decoder.go

Core symbols most depended-on inside this repo

errorExit
called by 112
cmd/kaf/kaf.go
getClusterAdmin
called by 19
cmd/kaf/kaf.go
remaining
called by 14
pkg/streams/decoder.go
getInt32
called by 7
pkg/streams/decoder.go
Done
called by 7
cmd/kaf/scram_client.go
Write
called by 6
pkg/config/config.go
getConfig
called by 6
cmd/kaf/kaf.go
getSchemaCache
called by 4
cmd/kaf/kaf.go

Shape

Method 69
Function 67
Struct 21
TypeAlias 2
Interface 1

Languages

Go100%

Modules by API surface

pkg/streams/decoder.go40 symbols
cmd/kaf/consume.go24 symbols
pkg/config/config.go12 symbols
pkg/partitioner/jvm.go11 symbols
cmd/kaf/group.go10 symbols
cmd/kaf/kaf.go9 symbols
pkg/avro/schema.go8 symbols
cmd/kaf/produce.go8 symbols
cmd/kaf/scram_client.go4 symbols
cmd/kaf/oauth.go4 symbols
cmd/kaf/main_test.go4 symbols
pkg/streams/subscription_info.go3 symbols

Dependencies from manifests, versioned

github.com/Azure/go-ansitermv0.0.0-2021061722524 · 1×
github.com/IBM/saramav1.43.2 · 1×
github.com/Landoop/schema-registryv0.0.0-2019032714375 · 1×
github.com/Masterminds/goutilsv1.1.1 · 1×
github.com/Masterminds/semverv1.5.0 · 1×
github.com/Masterminds/sprigv2.22.0+incompatible · 1×
github.com/Microsoft/go-winiov0.5.2 · 1×
github.com/aws/aws-msk-iam-sasl-signer-gov1.0.0 · 1×
github.com/aws/aws-sdk-go-v2v1.31.0 · 1×
github.com/aws/aws-sdk-go-v2/configv1.27.39 · 1×
github.com/aws/aws-sdk-go-v2/credentialsv1.17.37 · 1×
github.com/aws/aws-sdk-go-v2/feature/ec2/imdsv1.16.14 · 1×

For agents

$ claude mcp add kaf \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact