A supercharged, interactive Kafka shell built on top of the existing Kafka CLI tools.
Kafka shell allows you to configure a list of clusters, and properties such as --bootstrap-server
and --zookeeper
for the currently selected cluster will automatically be added when the command is run. No more remembering long server addresses or ports!
Kafka shell requires python
and pip
. Kafka shell is a wrapper over the existing Kafka command-line tools, so
those must exist within your PATH
.
You can install kafka-shell using pip:
pip install kafka-shell
Kafka shell is an interactive shell. You can run it from the terminal by:
kafka-shell
From here, you can start typing kafka
and the autocomplete will kick in.
Key Commands
F2
.F3
.F9
.F10
or by typing exit
. Kafka shell allows you to configure settings and Kafka clusters to run commands against through a configuration file.
By default, when kafka-shell
is first run, a directory in your home directory is generated at ~/.kafka-shell
. A configuration file called config.yaml
is generated in that new folder. It is a YAML file containing details about clusters, kafka-shell
configuration, and more.
See CONFIGURATION.md to add a cluster to your configuration or to set other kafka-shell
settings.
Kafka shell simplifies running complex Kafka CLI commands as well as provides smart auto-completion of commands, options, and more. /Users/shawn/.kafka-shell/config.yaml
Completion of Configurations
Auto completion of Kafka configuration keys and their values.
Configure Clusters, Schema Registries, & More
Configure clusters and their properties will automatically be added to commands being run.
Currently, the following commands are supported:
kafka-topics
kafka-configs
kafka-console-consumer
kafka-console-producer
kafka-avro-console-consumer
kafka-avro-console-producer
kafka-verifiable-consumer
kafka-verifiable-producer
kafka-preferred-replica-election
kafka-replica-verification
kafka-reassign-partitions
kafka-broker-api-versions
kafka-consumer-groups
kafka-delete-records
kafka-log-dirs
kafka-dump-log
kafka-acls
ksql
Helper Commands
Currently, kafka-shell has helper commands:
exit
: exit the shellclear
: clear the shellcluster-select
: select a clustercluster-describe
: describe a cluster configIn-line help for each command and option is shown by default. This can be toggled by F9
.
Contributions are very welcome. See CONTRIBUTING.md for details.
This project was inspired by multiple amazing shells & prompts, such as saws, kube-shell, kube-prompt, http-prompt, and wharfee. It was built using prompt-toolkit. Much ❤️ to Apache Kafka and Confluent for their helpful CLI tools.
Copyright (c) 2019 Shawn Seymour.
Licensed under the Apache 2.0 license.