kafui

command module
v0.1.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

README

Kafui

A k9s inspired terminal ui for kaf
It uses the same configuration file as kaf so you can use your existing kaf configuration to browse between kafkas.

Features

All demos below run against the built-in mock data source (kafui --mock), so you can reproduce every one of them without a broker. The .tape sources live in vhs/ and are rendered with VHS (vhs vhs/<feature>.tape).

Cluster management & dashboard

Multi-cluster overview with health status, version, broker/partition counts, an offline-only filter, on-demand refresh (r), an offline-only toggle (i), and connection validation from the actions menu. Reach it from anywhere with :.

Broker management

Live broker list with per-broker stats and disk usage, plus a broker:<id> detail page with Log Dirs / Configs / Metrics tabs (inline config editing and replica log-dir reassignment behind confirmation).

Broker management

Topic management

Rich topic list (partitions, replication, out-of-sync replicas, on-disk size), sorting, internal-topic visibility, CSV export, and create / clone / delete / recreate / purge flows with confirmation.

Topic management

Message browsing & producing

Browse messages with full metadata, headers, and lazily decoded payloads; seek by offset/timestamp, filter by partition or a smart-filter expression, mask sensitive fields, export, produce, and reproduce a browsed message.

Message browsing

Consumer groups & offsets

Group list enriched with state, members, topics, coordinator, and total lag, plus a detail page with topic-grouped partition lag, auto-refresh, and reset / delete flows.

Schema registry

Browse subjects, versions, and schema content with syntax highlighting and a side-by-side version diff; register new versions (with a compatibility check), delete, and set compatibility — all behind confirmation.

Schema registry

Kafka Connect

Connectors and connect clusters with live status, and a connector detail page (Overview / Tasks / Config / Topics) with lifecycle actions — pause, resume, stop, restart, delete, reset offsets — behind confirmation.

Kafka Connect

Streaming SQL (ksqlDB)

Streams and tables overview and an interactive query editor that streams SELECT ... EMIT CHANGES results row-by-row.

Streaming SQL (ksqlDB)

ACLs & client quotas

ACL bindings with pattern types, resource/pattern filters, and create / convenience forms (custom, or consumer/producer/stream expansion), plus CSV export & declarative sync. A sibling client-quotas resource (: then "quotas") views and edits quota entities.

Metrics & monitoring

Live message/throughput rates with unicode sparklines from an in-process history, an optional Prometheus query/graph surface, and an opt-in Prometheus exposition endpoint (--metrics-listen). Reach it with :.

Authentication, RBAC & audit

Per-cluster read-only mode (--read-only), local permission profiles enforced at the datasource boundary, a JSONL audit log, and an effective-permissions ("whoami") view. Every mutating operation is gated and audited.

Application configuration

A read-only view of the effective, merged configuration with secrets redacted, build info, and per-cluster details. A setup wizard (gated on dynamicConfigEnabled) adds, edits, and validates clusters. Both are reached with :.

Application configuration

UI shell & cross-cutting UX

A consistent shell across every page: full help overlay (?), a contextual hint bar whose entries are clickable, auto/dark/light theming, confirmation dialogs, notifications, deep-linking, and error pages. One key vocabulary throughout — see the controls spec.

UI shell

Command palette

: opens a palette listing every destination and every application-level command, found by typing part of its name. It replaces the per-screen jump keys the app used to have, and it teaches the direct shortcuts by showing each entry's key beside it. Commands the active cluster or your permissions do not allow stay listed but disabled, with the reason — so you learn the feature exists rather than wondering where it went.

Command palette

The companion surface is a (or right-click), which opens the same style of menu for whatever row is selected: everything you can do to it, each with its key and a one-letter mnemonic.

Scales to your terminal

Tables flex to whatever width they get: the text columns grow to fill a wide pane and truncate rather than wrap when you shrink it, so the same views stay usable from an 80-column split all the way up to a full-screen terminal. The same run is recorded below at three sizes.

~80 columns — a split pane

Responsive layout at 80 columns

~120 columns — a typical window

Responsive layout at 120 columns

~200 columns — full screen

Responsive layout at 200 columns

Re-record with ./vhs/render-responsive.sh.

Usage

$ kafui --help
Explore different kafka broker in a k9s fashion with quick switches between topics, consumer groups and brokers

Usage:
  kafui [flags]
  kafui [command]

Available Commands:
  get         Non-interactive resource listings (machine-readable)
  health      Probe cluster (and schema registry) connectivity; exit 0 if healthy
  version     Print kafui version and build information

Flags:
  -b, --brokers strings          Comma-separated list of broker host:port pairs (overrides config)
  -c, --cluster string           Set the active cluster/context by name
      --config string            config file (default is $HOME/.kaf/config)
  -h, --help                     help for kafui
      --metrics-listen string    Serve the current metrics snapshot in Prometheus exposition format on this address (e.g. :9090); default off
      --mock                     Enable mock mode: Display mock data to test various functions without a real kafka broker
      --read-only                Treat every cluster as read-only: deny all altering operations
      --resource string          Open the main page pre-switched to a resource
      --schema-registry string   Schema registry URL (overrides config)
      --topic string             Open the given topic directly on startup
  -v, --verbose                  Enable verbose sarama logging

Install

Winget

On windows you can install kafui using the following

winget install kafui
Homebrew

If you're using Homebrew on macOS or Linux, you can easily install kafui using the following commands:

brew tap benny93/kafui
brew install kafui

This will tap into the benny93/kafui repository and install the kafui package on your system.

Downloader Script

Install via downloader script:

curl https://raw.githubusercontent.com/Benny93/kafui/main/godownloader.sh | BINDIR=$HOME/bin bash
Go install
  1. Set Environment Variables (For Unix-like Systems):

    Make sure you have the GOPATH environment variable set. Add the following lines to your shell configuration file (e.g., ~/.bashrc for Bash, ~/.zshrc for Zsh):

    echo 'export GOPATH=$(go env GOPATH)' >> ~/.bashrc
    echo 'export PATH="$PATH:$GOPATH/bin"' >> ~/.bashrc
    

    For Bash, use ~/.bash_profile instead of ~/.bashrc.

    For Zsh, use ~/.zshrc.

    These commands ensure that the GOPATH and GOPATH/bin are added to your PATH environment variable, allowing you to execute Go binaries globally.

  2. Set Environment Variables (For Windows):

    Open Command Prompt as an administrator and run the following commands:

    setx GOPATH "%USERPROFILE%\go"
    setx PATH "%PATH%;%GOPATH%\bin"
    

    These commands set the GOPATH environment variable to %USERPROFILE%\go and add %GOPATH%\bin to the PATH environment variable, respectively. After running these commands, you might need to restart your Command Prompt session for the changes to take effect.

  3. Install via Go:

    Once the environment variables are set, you can install the package using go install. Run the following command:

    go install github.com/Benny93/kafui@latest
    

    This command fetches the latest version of the kafui package from the specified GitHub repository and installs it in your GOPATH/bin directory. After installation, you can execute the kafui command from anywhere in your terminal.

Configuration

First setup the config file at $HOME/.kaf/config using kaf

kaf config add-cluster local -b localhost:9092

replace localhost:9092 with your broker. If you use a schema registry open the config file and add the required configurations. See https://github.com/birdayz/kaf?tab=readme-ov-file#configuration

Your configuration may look something like this:

current-cluster: local
clusteroverride: ""
clusters:
- name: local
  version: ""
  brokers:
  - localhost:9092
  SASL: null
  TLS: null
  security-protocol: ""
  schema-registry-url: localhost:8085
  schema-registry-credentials: null

Test coverage

Coverage treemap

Created with go-cover-treemap

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
example
schema-registry command
schema-registry is a small verification program that uses the kafui datasource implementation to fetch schemas from the Confluent Schema Registry configured in ~/.kaf/config.
schema-registry is a small verification program that uses the kafui datasource implementation to fetch schemas from the Confluent Schema Registry configured in ~/.kaf/config.
pkg
analysis
Package analysis implements the UI-independent topic scan + aggregation engine (TP-29/TP-30).
Package analysis implements the UI-independent topic scan + aggregation engine (TP-29/TP-30).
api
appconfig
Package appconfig owns the kafui-managed configuration document.
Package appconfig owns the kafui-managed configuration document.
audit
Package audit records kafui operations (state-changing by default, optionally all) to a local JSONL file for accountability and review.
Package audit records kafui operations (state-changing by default, optionally all) to a local JSONL file for accountability and review.
authz
Package authz is kafui's local authorization layer: a permission model, an action vocabulary, and a Gate that classifies every datasource operation as allowed or denied for the active cluster profile.
Package authz is kafui's local authorization layer: a permission model, an action vocabulary, and a Gate that classifies every datasource operation as allowed or denied for the active cluster profile.
cluster
Package cluster provides a UI-independent background collector that polls every configured cluster for health, statistics, and capabilities, caching the results so the dashboard and sidebar can read them without blocking.
Package cluster provides a UI-independent background collector that polls every configured cluster for health, statistics, and capabilities, caching the results so the dashboard and sidebar can read them without blocking.
datasource
Package datasource holds cross-backend datasource decorators.
Package datasource holds cross-backend datasource decorators.
masking
Package masking implements data-masking rules applied at display time to already-rendered message key/value strings.
Package masking implements data-masking rules applied at display time to already-rendered message key/value strings.
messagefilter
Package messagefilter is a small smart-filter expression engine for Kafka messages (task MSG-24).
Package messagefilter is a small smart-filter expression engine for Kafka messages (task MSG-24).
metrics
Package metrics provides a UI-independent background collector that samples the active cluster's message counts and broker stats on an interval, derives message-in rates from the count deltas between cycles, and caches the results plus a rolling time-series history so the metrics page can read them without blocking.
Package metrics provides a UI-independent background collector that samples the active cluster's message counts and broker stats on an interval, derives message-in rates from the count deltas between cycles, and caches the results plus a rolling time-series history so the metrics page can read them without blocking.
metrics/graphs
Package graphs is a built-in catalog of Prometheus graph descriptions and the logic that renders their query templates and executes them against the optional time-series backend (pkg/metrics/promquery).
Package graphs is a built-in catalog of Prometheus graph descriptions and the logic that renders their query templates and executes them against the optional time-series backend (pkg/metrics/promquery).
metrics/jolokia
Package jolokia is an HTTP-bridge collector for JMX metrics exposed through a Jolokia agent.
Package jolokia is an HTTP-bridge collector for JMX metrics exposed through a Jolokia agent.
metrics/promquery
Package promquery is a minimal client for the Prometheus HTTP query API (/api/v1/query and /api/v1/query_range) built on the standard library only.
Package promquery is a minimal client for the Prometheus HTTP query API (/api/v1/query and /api/v1/query_range) built on the standard library only.
serde
Package serde is kafui's pluggable message serialization/deserialization framework.
Package serde is kafui's pluggable message serialization/deserialization framework.
ui
ui/components/datatable
Package datatable provides a reusable table component wrapping github.com/charmbracelet/bubbles/table.
Package datatable provides a reusable table component wrapping github.com/charmbracelet/bubbles/table.
ui/components/form
Package form provides a reusable, typed form model for create/edit flows.
Package form provides a reusable, typed form model for create/edit flows.
ui/components/menu
Package menu provides the filterable overlay list behind the two discovery surfaces the controls spec requires: the command palette (`:`) and the contextual actions menu (`a` / right-click).
Package menu provides the filterable overlay list behind the two discovery surfaces the controls spec requires: the command palette (`:`) and the contextual actions menu (`a` / right-click).
ui/components/tabstrip
Package tabstrip renders a tab bar whose tabs are click and hover targets.
Package tabstrip renders a tab bar whose tabs are click and hover targets.
ui/core
Package core provides core types and interfaces for the Kafui UI framework.
Package core provides core types and interfaces for the Kafui UI framework.
ui/debug
Package debug provides debugging utilities for Kafui.
Package debug provides debugging utilities for Kafui.
ui/dialog
Package dialog provides the root-owned modal confirmation overlay used for destructive-action confirmation across all pages.
Package dialog provides the root-owned modal confirmation overlay used for destructive-action confirmation across all pages.
ui/keys
Package keys is the single binding registry required by the controls specification (kafui-specification/controls).
Package keys is the single binding registry required by the controls specification (kafui-specification/controls).
ui/layout
Package layout provides centralized layout management for the Kafui UI.
Package layout provides centralized layout management for the Kafui UI.
ui/notify
Package notify provides the shell-owned notification (status line) system: severity-styled, auto-expiring, deduplicated transient messages rendered in the footer area.
Package notify provides the shell-owned notification (status line) system: severity-styled, auto-expiring, deduplicated transient messages rendered in the footer area.
ui/pages/appconfig_view
Package appconfig_view contains the read-only "Application Config" page.
Package appconfig_view contains the read-only "Application Config" page.
ui/pages/broker
Package broker implements the broker detail page (dynamic page ID "broker:<id>").
Package broker implements the broker detail page (dynamic page ID "broker:<id>").
ui/pages/cluster_form
Package cluster_form implements the cluster setup-wizard page (AC-12/AC-13): add, edit or delete a cluster in the kafui-owned config, validate connectivity without saving, and apply changes with an in-place datasource reload.
Package cluster_form implements the cluster setup-wizard page (AC-12/AC-13): add, edit or delete a cluster in the kafui-owned config, validate connectivity without saving, and apply changes with an in-place datasource reload.
ui/pages/clusters
Package clusters implements the cluster overview dashboard page (page ID "clusters").
Package clusters implements the cluster overview dashboard page (page ID "clusters").
ui/pages/connector
Package connector implements the connector detail page (dynamic page ID "connector:<connect>:<name>").
Package connector implements the connector detail page (dynamic page ID "connector:<connect>:<name>").
ui/pages/consumer_group
Package consumergroup implements the consumer-group detail page (dynamic page ID "consumer_group:<groupID>").
Package consumergroup implements the consumer-group detail page (dynamic page ID "consumer_group:<groupID>").
ui/pages/errorpage
Package errorpage provides a full-content error view used as the router's fallback for unknown/uncreatable routes (UI-10).
Package errorpage provides a full-content error view used as the router's fallback for unknown/uncreatable routes (UI-10).
ui/pages/ksql
Package ksql implements the ksqlDB UI: an overview page (page ID "ksql") listing the cluster's streams and tables in two tabs, and a query editor page (page ID "ksql_query") for executing statements and streaming SELECT results.
Package ksql implements the ksqlDB UI: an overview page (page ID "ksql") listing the cluster's streams and tables in two tabs, and a query editor page (page ID "ksql_query") for executing statements and streaming SELECT results.
ui/pages/main
Package mainpage contains the main page components for the Kafui application.
Package mainpage contains the main page components for the Kafui application.
ui/pages/message_detail
Package messagedetail contains the message detail page components for the Kafui application.
Package messagedetail contains the message detail page components for the Kafui application.
ui/pages/metrics
Package metrics implements the metrics & monitoring page (page ID "metrics").
Package metrics implements the metrics & monitoring page (page ID "metrics").
ui/pages/resource_detail
Package resource_detail contains the resource detail page components for the Kafui application.
Package resource_detail contains the resource detail page components for the Kafui application.
ui/pages/topic
Package topic contains the topic page components for the Kafui application.
Package topic contains the topic page components for the Kafui application.
ui/shared/aclcsv
Package aclcsv provides pure CSV serialization/parsing of ACL bindings and a declarative sync (diff + apply) between a desired binding set and the cluster.
Package aclcsv provides pure CSV serialization/parsing of ACL bindings and a declarative sync (diff + apply) between a desired binding set and the cluster.
version
Package version exposes build metadata injected via -ldflags -X at build time.
Package version exposes build metadata injected via -ldflags -X at build time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL