# MQTT TUI Subscribe to a MQTT Topic or publish something quickly from the terminal ## Features ### Terminal UI ![Screenshot of the interactive terminal UI](media/tui.png) ```bash # Subscribe to everything (#) mqttui # Subscribe to topic mqttui "topic" # Subscribe to topic with a specific host (default is mqtt://localhost) mqttui --broker "mqtt://test.mosquitto.org" "hello/world" # More arguments and details mqttui --help ``` ### Publish ```bash mqttui publish "hello" "world" mqttui publish --retain "foo/bar" "Banana?" # Use stdin to publish file contents mqttui publish "foo/bar" --.zip` Choose the correct file for your given CPU architecture and platform. The prebuilt CPU architectures include: - AMD/Intel: x86_64 - 64 bit ARMv8: aarch64 - 64 bit RISC-V: riscv64gc - 32 bit ARMv7: armv7 - 32 bit ARMv6: arm #### Debian, Ubuntu, and Deb based Linux Download the appropriate `.deb` for your architecture and run: ```bash sudo dpkg -i ``` #### Red Hat, CentOS, and RPM based Linux Download the appropriate `.rpm` for your architecture and run: ```bash sudo rpm -i ``` #### Tarball for other UNIX based systems The binaries are also shipped as plain tarballs, targeting each architecture for any generic Linux or macOS. Note that the Linux binaries are built for `glibc` based systems. You will need to compile [from source](#from-source) for other `libc`/`musl` systems like Alpine Linux (or install via repos). You need to extract the tarball and put the binary somewhere on your path (common locations are `~/bin`, `~/.local/bin` or `/usr/local/bin`). #### Windows Download the appropriate `mqttui---pc-windows-msvc.zip` for your architecture and extract the content somewhere useful. ### From Source - Clone this repository - `cargo install --path .` ## History and Alternatives Taking a look into existing "lets just view MQTT right now" or "quickly publish something" projects they are always quite bulky and not that fast. Before 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. But while it's running its eating up a lot of resources. Publishing something quickly from command line is also not that fun. The 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. Subscribing to many topics also isn't as useful to watch at as I hoped for. While [`mosquitto_sub` and `mosquitto_pub`](https://mosquitto.org/) are bundled when installing Mosquitto they are also a bit bulky to use. That's why I started building my own terminal based version to quickly watch or publish MQTT stuff. It won't be as feature rich as something like the HiveMQ CLI approach, but it aims at being easy to use and fast.