OpenKommander is a command line utility and admin UI for Apache Kafka compatible brokers.
- Podman (required for running the development environment)
- Make (required for running development commands)
-
Install Podman Follow the installation instructions for your operating system on the Podman website.
-
Clone the repository
git clone https://github.com/IBM/openkommander.git cd openkommander -
Start the development environment
make setup make dev
-
Execute into the container
podman exec -it openkommander-app-1 bashNote: Replace
openkommander-app-1in case your is different -
Build and install cli
make dev-run
The application uses a configuration file located at config/config.yaml. By default, it is configured for the development environment:
kafka:
broker: kafka:9093You can modify config/config.yaml to connect to different Kafka clusters:
# Development environment (default)
kafka:
broker: kafka:9093
# Custom environment example
kafka:
broker: localhost:9092 # For local Kafka installation
# broker: kafka-cluster.example.com:9093 # For remote clusterThe configuration file is loaded when the application starts. If you need to connect to a different broker after starting the application, you can use the ok login command with a custom broker address:
$ ok login
Enter broker address [kafka:9093]: localhost:9092After running the application, you can use the following commands:
All commands start with prefix ok
| Command | Description | Arguments |
|---|---|---|
login |
Connect to a Kafka cluster | None |
logout |
End the current session | None |
session |
Display current session information | None |
metadata |
Display cluster information | None |
topics |
Topic management commands | Subcommands: create, list, delete |
help |
Display available commands | None |
OpenKommander provides a set of commands to manage Kafka topics:
| Command | Description | Interactive Prompts |
|---|---|---|
topics create |
Create a new Kafka topic | Topic name, partitions, replication factor |
topics list |
List all available topics | None |
topics delete |
Delete an existing topic | Topic name |
| Endpoint | Method | Description | Request Body | Response |
|---|---|---|---|---|
/topics |
GET | List all topics | None | JSON object with topic details |
/topics |
POST | Create a new topic | JSON with name, partitions, and replication_factor | Success message |
/topics/{topicName} |
DELETE | Delete a topic | None | Success message |
-
Build the CLI:
make build
-
Install the CLI:
make install
Note: It may fail due to permission if needed add
sudofor examplesudo make install
-
Connect to the cluster:
$ ok login Connected to Kafka cluster at kafka:9093
-
View session information:
$ ok session Current session: Brokers: [kafka:9093], Authenticated: true -
View cluster information:
$ ok metadata Cluster Brokers: - kafka:9093 (ID: 1)
-
Create a new topic:
$ ok topics create Enter topic name: my-new-topic Enter number of partitions (default 1): 3 Enter replication factor (default 1): 2 Successfully created topic 'my-new-topic' with 3 partitions and replication factor 2 -
List all topics:
$ ok topics list Topics: -------- Name: my-new-topic Partitions: 3 Replication Factor: 2
-
Delete a topic:
$ ok topics delete Enter topic name to delete: my-new-topic Successfully deleted topic 'my-new-topic' -
End session and exit:
$ ok logout Logged out successfully!