Skip to content
Kafka
Search documentation…
⌘ K
Search documentation
Search documentation
Esc
Start
Introduction
A command-line admin client for Apache Kafka
Introduction
A generic, zero-dependency config-file loader
Introduction
A TypeScript Kafka client for Kafka 0.10+
Introduction
A local web UI for inspecting and driving an Apache Kafka cluster
Installation
Run @cookiemonsterdev/kafka-cli with npx, pnpm dlx, or a global install
Installation
Install @cookiemonsterdev/kafka-core with npm, pnpm, yarn, or bun
Installation
Install @cookiemonsterdev/kafka-studio, standalone or through the CLI
Getting started
Run your first commands against a broker
Getting started
Create a client and send or consume messages
Guides
Configuration
kafka.config files, profiles, and resolution order
Producer
send, sendBatch, acks, linger, partitioners, and abort
Running it against a broker
Point the studio at a real cluster, or a one-command local Docker broker
Consumer
subscribe, run, stream, pause, seek, and assigners
Output and scripting with JSON
Machine-readable output, exit codes, and jq recipes
Admin
Topics, configs, offsets, groups, ACLs, and SCRAM
Errors
Catch KafkaError, retries, and broker protocol codes
Security
TLS and SASL PLAIN, SCRAM, OAUTHBEARER, GSSAPI, and delegation tokens
Testing
Run unit and integration tests against a broker version
Throughput
Throughput preset, linger and batching, and the heavy-load consume API
Observability
Client-side OpenTelemetry metrics from instrumentation events
Configuration
Share KafkaConfig across producer, consumer, and admin with a kafka.config.ts file
Reference
API reference
discoverConfigFile, loadConfigFileAsync (and the deprecated loadConfigFileSync), mergeConfigLayers, createDefineConfig
API reference
The studio server's HTTP surface, its response envelope, and its security model
Command reference
Every kafka command, one page each, generated from the command registry
Kafka client
new Kafka, producer, consumer, admin, and logger
Exit codes
The exit-code taxonomy every command shares
Producer API
Producer methods, Message, and RecordMetadata
Consumer API
Consumer methods, KafkaMessage, and run options
Admin API
Implemented admin methods
Configuration
KafkaConfig, ProducerConfig, ConsumerConfig, and AdminConfig
Errors
Public error classes and broker protocol codes
Public API
What @cookiemonsterdev/kafka-core exports
Compatibility
Broker support and constructor defaults, the implemented surface, and APIs this client does not implement
Config file
kafka.config.* discovery, precedence, Kafka.fromConfig, and Kafka.from
completion
Print a shell completion script for bash, zsh, or fish
Environment variables and secrets
fromEnv, the KAFKA_* allow-list, and redactKafkaConfig
Bun
Supported runtimes, running the CLI and studio on Bun, and what behaves differently there
doctor
Report where connection settings come from — config file, environment, profile, or flag
init
Scaffold a kafka.config file in the current directory
ping
Check connectivity to the cluster
profiles
List the named connection profiles configured under cli.profiles
studio
Launch the local web UI for browsing and driving the cluster
acl add
Create one or more ACLs, granting or denying an operation
acl list
List ACLs matching a filter, or every ACL by default
acl remove
Delete every ACL matching a filter, per principal
admin call
Call any Admin method by name — the escape hatch for everything without its own command
admin methods
List every Admin method admin call can reach, and how each is classified
cluster elect-leaders
Trigger a preferred or unclean leader election on one or more partitions
cluster features
Describe supported and finalized feature versions
cluster info
Describe the cluster: its brokers, controller, and cluster id
cluster log-dirs
Describe log directories and their partition sizes, per broker
cluster quorum
Describe the metadata quorum: leader, voters, and observers
cluster raft-voter add
Add a voter to the KRaft metadata quorum
cluster raft-voter remove
Remove a voter from the KRaft metadata quorum
cluster reassign execute
Execute a partition reassignment from a kafka-reassign-partitions.sh-shaped JSON file
cluster reassign list
List every active partition reassignment
cluster unregister-broker
Unregister a broker from the cluster (KRaft broker decommissioning)
cluster update-features
Upgrade, safe-downgrade, or unsafe-downgrade one or more finalized feature versions
config describe
Describe the configs of one or more resources
config list-resources
List every config resource the broker knows about
config set
Set one or more config entries on a resource
config unset
Remove one or more config entries from a resource, reverting them to default
group delete
Delete one or more consumer groups
group delete-offsets
Delete a consumer group's committed offsets on one or more topics
group describe
Describe one or more consumer groups
group list
List every consumer group the cluster knows about
group offsets
Show a consumer group's committed offsets
group remove-members
Remove one or more static members from a consumer group's session
group reset-offsets
Reset a consumer group's committed offsets on one or more topics
quota alter
Set or remove client quota values for one entity
quota describe
Describe client quotas matching an entity filter
scram delete
Delete a SCRAM credential for one or more users
scram list
List SCRAM credentials for one or more users, or every user
scram set
Create or update a SCRAM credential for one or more users
share-group delete
Delete one or more share groups
share-group describe
Describe one or more share groups
share-group list
List every share group the cluster knows about
share-group offsets
Read, set, or delete a share group’s committed start offsets
token create
Create a delegation token
token expire
Expire a delegation token, immediately by default
token list
List delegation tokens, optionally filtered by owner
token renew
Renew a delegation token, extending its expiry
topic add-partitions
Raise a topic to a new total partition count
topic create
Create one or more topics
topic delete
Delete one or more topics
topic delete-records
Delete records before a given offset, per partition
topic describe
Describe one or more topics
topic list
List every topic
topic offsets
Show partition offsets for a topic
topic producers
Show a topic's active producer state, per partition
txn abort
Write an abort marker for one in-flight transaction on a topic partition
txn describe
Describe one or more transactional ids
txn fence
Fence out a transactional id's current producer, bumping its epoch
txn list
List transactions known to the cluster, optionally filtered
txn terminate
Force-terminate a transactional id's current transaction
Migration
Breaking changes
Offsets as bigint, MessageSet, built-in ZSTD, and environment variables
Package
Core
Node.js client
Search documentation…
Start
Introduction
Installation
Getting started
Guides
Producer
Consumer
Admin
Errors
Security
Testing
Throughput
Observability
Configuration
Reference
Kafka client
Producer API
Consumer API
Admin API
Configuration
Error catalog
Public API
Compatibility
Config file
Environment variables and secrets
Bun
Migration
Breaking changes
GitHub
The TypeScript Kafka client for Node.js
Talk to brokers from Kafka 0.10 onward. Produce, consume, and administer.
Get started
Introduction
npm install @cookiemonsterdev/kafka-core