{"id":13586979,"url":"https://github.com/EdJoPaTo/mqttui","last_synced_at":"2025-04-07T18:35:23.877Z","repository":{"id":37049634,"uuid":"303429896","full_name":"EdJoPaTo/mqttui","owner":"EdJoPaTo","description":"Subscribe to a MQTT Topic or publish something quickly from the terminal","archived":false,"fork":false,"pushed_at":"2024-10-23T12:02:53.000Z","size":1172,"stargazers_count":381,"open_issues_count":7,"forks_count":22,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-29T17:13:39.461Z","etag":null,"topics":["cli","hacktoberfest","mqtt","mqtt-cli","mqtt-client","mqtt-explorer","mqtt-topic","terminal-based"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EdJoPaTo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-12T15:12:43.000Z","updated_at":"2024-10-27T01:54:16.000Z","dependencies_parsed_at":"2024-06-03T20:34:33.784Z","dependency_job_id":"77cbec41-a522-4a94-a084-fe41391fe2e5","html_url":"https://github.com/EdJoPaTo/mqttui","commit_stats":{"total_commits":375,"total_committers":7,"mean_commits":53.57142857142857,"dds":0.5546666666666666,"last_synced_commit":"216117e085a96af96ca5de569de704c9bfffb9fc"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdJoPaTo%2Fmqttui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdJoPaTo%2Fmqttui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdJoPaTo%2Fmqttui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdJoPaTo%2Fmqttui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EdJoPaTo","download_url":"https://codeload.github.com/EdJoPaTo/mqttui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223095336,"owners_count":17086613,"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","hacktoberfest","mqtt","mqtt-cli","mqtt-client","mqtt-explorer","mqtt-topic","terminal-based"],"created_at":"2024-08-01T15:05:56.848Z","updated_at":"2024-11-06T05:31:01.077Z","avatar_url":"https://github.com/EdJoPaTo.png","language":"Rust","funding_links":[],"categories":["Tools","Rust","Table of Contents","\u003ca name=\"networking\"\u003e\u003c/a\u003eNetworking","💻 Apps"],"sub_categories":["Talks","🌐 Networking and Internet"],"readme":"# MQTT TUI\n\nSubscribe to a MQTT Topic or publish something quickly from the terminal\n\n## Features\n\n### Terminal UI\n\n![Screenshot of the interactive terminal UI](media/tui.png)\n\n```bash\n# Subscribe to everything (#)\nmqttui\n\n# Subscribe to topic\nmqttui \"topic\"\n\n# Subscribe to topic with a specific host (default is mqtt://localhost)\nmqttui --broker \"mqtt://test.mosquitto.org\" \"hello/world\"\n\n# More arguments and details\nmqttui --help\n```\n\n### Publish\n\n```bash\nmqttui publish \"hello\" \"world\"\n\nmqttui publish --retain \"foo/bar\" \"Banana?\"\n\n# Use stdin to publish file contents\nmqttui publish \"foo/bar\" \u003c/etc/hostname\n# or other things\ncowsay \"I was here\" | mqttui publish \"foo/bar\"\n\n# More arguments and details\nmqttui publish --help\n```\n\n### Log to stdout\n\n```plaintext\n$ mqttui log \"espHome-co2/sensor/#\" \"espHome-test/sensor/temperature/state\"\nRETAINED     espHome-co2/sensor/rssi/state                      QoS:AtMostOnce  Payload(  6): -80.09\nRETAINED     espHome-co2/sensor/co2/state                       QoS:AtMostOnce  Payload(  5): 450.8\nRETAINED     espHome-co2/sensor/temperature/state               QoS:AtMostOnce  Payload(  6): 22.129\nRETAINED     espHome-co2/sensor/humidity/state                  QoS:AtMostOnce  Payload(  5): 25.18\nRETAINED     espHome-test/sensor/temperature/state              QoS:AtMostOnce  Payload(  6): 10.339\n12:10:06.650 espHome-test/sensor/temperature/state              QoS:AtMostOnce  Payload(  6): 10.454\n12:10:39.606 espHome-co2/sensor/co2/state                       QoS:AtMostOnce  Payload(  5): 432.5\n12:10:53.860 espHome-co2/sensor/temperature/state               QoS:AtMostOnce  Payload(  6): 21.974\n12:12:06.644 espHome-test/sensor/temperature/state              QoS:AtMostOnce  Payload(  6): 10.536\n12:12:39.556 espHome-co2/sensor/co2/state                       QoS:AtMostOnce  Payload(  5): 404.3\n12:12:53.859 espHome-co2/sensor/temperature/state               QoS:AtMostOnce  Payload(  6): 21.921\n12:13:20.146 espHome-co2/sensor/humidity/state                  QoS:AtMostOnce  Payload(  5): 25.11\n12:13:27.906 espHome-co2/sensor/rssi/state                      QoS:AtMostOnce  Payload(  6): -79.81\n12:14:06.643 espHome-test/sensor/temperature/state              QoS:AtMostOnce  Payload(  6): 10.568\n```\n\n```bash\n# Subscribe to topic\nmqttui log \"topic\"\n\n# Multiple topics\nmqttui log \"topic1\" \"topic2\"\n\n# More arguments and details\nmqttui log --help\n```\n\n### Read a single payload to stdout\n\nIn scripts, it's helpful to get the current payload of a specific topic.\n\n```bash\n# Print the first received message to stdout and the topic to stderr\nmqttui read-one room/temp\n\n# Save the payload to a bash variable to use it\ntemp=$(mqttui read-one room/temp)\necho \"The temperature is $temp right now\"\n\n# Wait for a non retained message (default when there is none)\ntemp=$(mqttui read-one --ignore-retained room/temp)\necho \"Breaking news: We just received an updated temperature of $temp\"\n\n# More arguments and details\nmqttui read-one --help\n```\n\n### Clean retained topics\n\nUse the interactive TUI and press Delete or Backspace on a topic to clean the tree or use the sub-command.\n\n![Screenshot of the TUI with the cleaning dialog open](media/clean-interactive.png)\n\n```plaintext\n$ mqttui publish --retain \"hello\" \"world\"\n\n$ mqttui clean-retained \"hello\"\nRETAINED     hello          QoS:AtLeastOnce Payload(  5): world\nCleaned 1 topics\n```\n\n```bash\n# Clean the topic\nmqttui clean-retained \"topic\"\n\n# Clean the topic tree below\nmqttui clean-retained \"topic/#\"\n\n# More arguments and details\nmqttui clean-arguments --help\n```\n\n### Configure via environment variables\n\nSee the `--help` command for environment variables to be set.\n\nPersonally I have set my default broker, so I don't have to use `--broker` all the time:\n\n```bash\nexport MQTTUI_BROKER=mqtt://pi-home.local\n\n# Use the command without specifying the broker every time\nmqttui \"topic\"\n```\n\n## Install\n\n### Packaged\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/mqttui.svg?columns=2\u0026exclude_unsupported=1)](https://repology.org/project/mqttui/versions)\n\n#### Arch Linux\n\n```bash\npacman -S mqttui\n```\n\n#### Homebrew (Mac or Linux)\n\n```bash\nbrew install mqttui\n```\n\n### Prebuilt\n\nCheck the [Releases](https://github.com/EdJoPaTo/mqttui/releases).\n\n### From Source\n\n- Clone this repository\n- `cargo install --path .`\n\n## History and Alternatives\n\nTaking a look into existing \"lets just view MQTT right now\" or \"quickly publish something\" projects they are always quite bulky and not that fast.\n\nBefore having `mqttui` I used [thomasnordquist/MQTT-Explorer](https://github.com/thomasnordquist/MQTT-Explorer) as it has a great overview of what's going on, a small topic based history and a sorted main view.\nBut while it's running its eating up a lot of resources.\n\nPublishing something quickly from command line is also not that fun.\nThe feature rich CLI alternative [hivemq/mqtt-cli](https://github.com/hivemq/mqtt-cli) takes some time to do its job and is not as easy to use as it has a lot of flags to specify.\nSubscribing to many topics also isn't as useful to watch at as I hoped for.\n\nWhile [`mosquitto_sub` and `mosquitto_pub`](https://mosquitto.org/) are bundled when installing Mosquitto they are also a bit bulky to use.\n\nThat's why I started building my own terminal based version to quickly watch or publish MQTT stuff.\nIt won't be as feature rich as something like the HiveMQ CLI approach, but it aims at being easy to use and fast.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEdJoPaTo%2Fmqttui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEdJoPaTo%2Fmqttui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEdJoPaTo%2Fmqttui/lists"}