kafka-shell
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!
Installation
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
Usage
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
- Change Cluster: The selected cluster commands are run against can be cycled through by pressing
F2. - Fuzzy Search: By default, fuzzy search of commands is enabled. This can be toggled on & off by pressing
F3. - In-line Help: By default, in-line help is shown along side the drop-down suggestion list. This can be toggled on & off by pressing
F9. - Exit: The shell can be exited by pressing
F10or by typingexit.
Configuration
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.
Features
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
- Auto-completion of commands, options, and configurations
- Configure clusters to run commands against and switch between them
- Fish-style auto suggestions
- Command history
- Contextual help
- Toolbar options
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.
Supported Commands
Currently, the following commands are supported:
kafka-topicskafka-configskafka-console-consumerkafka-console-producerkafka-avro-console-consumerkafka-avro-console-producerkafka-verifiable-consumerkafka-verifiable-producerkafka-preferred-replica-electionkafka-replica-verificationkafka-reassign-partitionskafka-broker-api-versionskafka-consumer-groupskafka-delete-recordskafka-log-dirskafka-dump-logkafka-aclsksql
Helper Commands
Currently, kafka-shell has helper commands:
exit: exit the shellclear: clear the shellcluster-select: select a clustercluster-describe: describe a cluster config
In-line help for each command and option is shown by default. This can be toggled by F9.
Contributing
Contributions are very welcome. See CONTRIBUTING.md for details.
Acknowledgement
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.
License
Copyright (c) 2019 Shawn Seymour.
Licensed under the Apache 2.0 license.
Metadata
Release files for kafka-shell 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kafka-shell-0.1.4.tar.gz | 30.1 kB | Without provenance | Details for kafka-shell-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kafka_shell-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for kafka_shell-0.1.4-py3-none-any.whl |
Total release size: 75.1 kB
Release files / kafka-shell-0.1.4.tar.gz
| Download URL | kafka-shell-0.1.4.tar.gz |
|---|---|
| Size | 30.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7bd4bda672ef34f8045173ca27ab84721c435a2558514a12e5251c085cb87a79
|
|
BLAKE2b-256 checksum How to use checksums |
265dbbb152ff0448358fa8d5cea006a15a64bba84f02fbb7f13e084c040c23cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.5
|
Release files / kafka_shell-0.1.4-py3-none-any.whl
| Download URL | kafka_shell-0.1.4-py3-none-any.whl |
|---|---|
| Size | 45.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
891e6e7e53967a7ff4330dde9a6ce2beba1fef0d905acea04cd09d9b38b76d46
|
|
BLAKE2b-256 checksum How to use checksums |
6b3b7e06a2888c230fa9ac910fe8049a4dc1b3c60525b7a68ce4d2e9c951482e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.5
|
Security for kafka-shell 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.