Skip to content

birdayz/kaf

Folders and files

NameName
Last commit message
Last commit date
Oct 15, 2021
Oct 15, 2021
Mar 9, 2021
Mar 9, 2021
Mar 10, 2021
Jun 28, 2020
Mar 17, 2020
Sep 11, 2018
Dec 30, 2020
Oct 18, 2021
Feb 7, 2019
Feb 7, 2019
May 26, 2020
Sep 6, 2021
Sep 6, 2021
Jun 25, 2019

Repository files navigation

Kaf

Kafka CLI inspired by kubectl & docker

Actions Status GoReportCard GoDoc

asciicinema

Install

Install from source:

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

Install binary:

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

Install on Archlinux via AUR:

yay -S 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

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

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

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")