{"id":17924349,"url":"https://github.com/fhussonnois/kafkacli","last_synced_at":"2025-03-24T02:33:39.614Z","repository":{"id":57520459,"uuid":"88266611","full_name":"fhussonnois/kafkacli","owner":"fhussonnois","description":"CLI and Go Clients to manage Kafka components (Kafka Connect \u0026 SchemaRegistry)","archived":false,"fork":false,"pushed_at":"2017-05-17T21:19:22.000Z","size":45,"stargazers_count":29,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T01:11:23.723Z","etag":null,"topics":["cli-utilities","kafka","kafka-cli","kafka-connect","schema-registry"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fhussonnois.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-14T12:40:16.000Z","updated_at":"2024-04-24T12:05:06.000Z","dependencies_parsed_at":"2022-09-26T18:00:58.582Z","dependency_job_id":null,"html_url":"https://github.com/fhussonnois/kafkacli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhussonnois%2Fkafkacli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhussonnois%2Fkafkacli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhussonnois%2Fkafkacli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhussonnois%2Fkafkacli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fhussonnois","download_url":"https://codeload.github.com/fhussonnois/kafkacli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245199080,"owners_count":20576486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-utilities","kafka","kafka-cli","kafka-connect","schema-registry"],"created_at":"2024-10-28T20:48:27.968Z","updated_at":"2025-03-24T02:33:39.312Z","avatar_url":"https://github.com/fhussonnois.png","language":"Go","funding_links":[],"categories":["CLI / Tools"],"sub_categories":[],"readme":"Kafka CLI\n=============================================================\n\n[![Build Status](https://travis-ci.org/fhussonnois/kafkacli.svg?branch=master)](https://travis-ci.org/fhussonnois/kafkacli)\n[![GoDoc](https://img.shields.io/badge/docs-GoDoc-blue.svg)](https://godoc.org/github.com/fhussonnois/kafkacli)\n\n[Apache Kafka](http://kafka.apache.org/) is a high-throughput, distributed, publish-subscribe messaging system.\n\n##  Requirements\n------------\n\n1. [Kafka 0.9.0.* or latest releases](http://kafka.apache.org/downloads.html)\n2. [Confluent 3.0.* or latest releases](https://www.confluent.io/download/)\n\n## How to build project ?\n\n[Go Lang](https://golang.org/doc/install) must be installed in order to build the project.\n\nYou can used the command ```go get``` can be used to retrieve and build the project directly from GitHub.\n\n```bash\ngo get github.com/fhussonnois/kafkacli/cmd/...\n```\n\nThe script ```./release.sh``` can be used to package project tar.gz for all OS/architectures.\n\n## Setting defaults Host/Port for use by the CLI\n\nSetting your host/port for use by the CLI tools can be done in a number of ways, here are some approaches:\n\n* Set the HOST and PORT environment variables.\n\n  To set these variables on Linux, macOS, or Unix, use export:\n\n  ```\n  export SCHEMA_REGISTRY_HOST=your_schema_registry_host\n  export SCHEMA_REGISTRY_PORT=your_schema_registry_port\n  ```\n\n  ```\n  export KAFKA_CONNECT_HOST=your_kafka_connect_host\n  export KAFKA_CONNECT_PORT=your_kafka_connect_port\n  ```\n\n* Set the HOST and PORT in the CLI profile properties file on your local system, located at:\n  * ~/.kafkacli/host on Linux, macOS, or Unix\n\n  This file should contain lines in the following format:\n  ```\n  # Kafka Connect\n  kafka_connect_host = your_kafka_connect_host\n  kafka_connect_port = your_kafka_connect_port\n\n  # Schema Registry\n  schema_registry_host = your_schema_registry_host\n  schema_registry_port = your_schema_registry_port\n  ```\n* Set the HOST and PORT while specifying command to run :\n\nThe CLI commands accept both arguments `-host` and `-port`\n\n## Kafka Connect CLI\n\nA simple Command line interface (CLI) to manage connectors through the Kafka Connect REST Interface.\n\n### Run command\n```bash\n./bin/kafka-connect-cli\n```\n\n### Usage\n\n```\nA simple Command line interface (CLI) to manage connectors through the Kafka Connect REST Interface.\n\nUsage of ./bin/kafka-connect-cli: command [arguments]\nThe commands are :\n\n    list            Listing active connectors on a worker.\n    config          Getting connector configuration.\n    create          Creating a new connector.\n    delete          Deleting a connector.\n    delete-all      Deleting all connectors.\n    pause           Pausing a connector (useful if downtime is needed for the system the connector interacts with).\n    plugins         Listing installed connectors plugins.\n    resume          Restarting a connector.\n    restart-failed  Restarting failed tasks for a connector.\n    status          Getting connector status.\n    tasks           Getting tasks for a connector.\n    scale           Scaling up the number of tasks for a connector.\n    update          Updating connector configuration.\n    version         Getting a connect worker version.\n\nUse \"kafka-connect-cli help [command]\" for more information about that command.\n\n```\n\n### Examples\n\n#### How to create a new connector instance ?\n\nA new connector configuration can be passed through either json or properties file.\n\n```\nUsage of create: Creating a new connector.\nThe arguments are :\n  -config string\n    \tThe connector configuration json string. (Required)\n  -config.json string\n    \t\u003cfile\u003e The connector configuration json file. (Required)\n  -config.props string\n    \t\u003cfile\u003e The connector configuration properties file. (Required)\n  -host string\n    \tThe connector worker host address. (Required) (default \"localhost\")\n  -port int\n    \tThe connector worker port. (Required) (default 8083)\n  -pretty\n    \tPretty print json output.\n```\n\n#### How to display all connectors with failed tasks ?\n\nSometime it can be useful to quickly identify which connectors have failed tasks.\n\n```bash\n./kafka-connect-cli list -pretty -with-state failed\n```\n\n## Confluent Schema registry\n\nA simple Command line interface (CLI) to manage [Confluent](http://docs.confluent.io/current/schema-registry/docs/api.html) Schema Registry.\n\n### Run command\n```bash\n./bin/schema-registry-cli\n```\n\n### Usage\n\n```\nA simple Command line interface (CLI) to manage Confluent Schema Registry.\n\nUsage of ./bin/schemaregistrycli: command [arguments]\nThe commands are :\n\n\tcompatibility            Getting subject compatibility level for a subject.\n\texist                    Checking if a schema has already been registered under the specified subject\n\tget                      Getting a specific version of the schema registered under this subject\n\tglobal-compatibility     Getting the global compatibility level.\n\tregister                 Registering a new schema under the specified subject.\n\tset-compatibility        Setting a new compatibility level.\n\tsubjects                 Getting the list of registered subjects.\n\ttest                     Testing schemas for compatibility against specific versions of a subject’s schema.\n\tversions                 Getting a list of versions registered under the specified subject.\n\nUse \"schema-registry-cli help [command]\" for more information about that command.\n```\n\n### Examples\n\n#### How to register schema from URL ?\n\n```bash\n./bin/schema-registry-cli register -schema.url https://gist.githubusercontent.com/fhussonnois/e2d0d279dfa82ac038bd5776fe2486ae/raw/735ee897dac24e6c43cd1b5c4c84766701ed2c88/user.avsc \\\n-subject user -pretty\n\n{\n    \"id\": 1\n}\n```\n#### How to retrieve only Avro schema from subject version ?\n\nThe option `schema` can be used to retieve only Avro schema of given subject without the version of the SchemaRegistry.\n\n```bash\n./bin/schema-registry-cli get -pretty -schema -subject user\n\n{\n    \"fields\": [\n        {\n            \"name\": \"name\",\n            \"type\": \"string\"\n        },\n        {\n            \"name\": \"favorite_number\",\n            \"type\": [\n                \"int\",\n                \"null\"\n            ]\n        },\n        {\n            \"name\": \"favorite_color\",\n            \"type\": [\n                \"string\",\n                \"null\"\n            ]\n        }\n    ],\n    \"name\": \"User\",\n    \"namespace\": \"example.avro\",\n    \"type\": \"record\"\n}\n```\n\n## Contributions\nAny contribution is welcome\n\n## Licence\nLicensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhussonnois%2Fkafkacli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffhussonnois%2Fkafkacli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhussonnois%2Fkafkacli/lists"}