• Stars
    star
    356
  • Rank 119,446 (Top 3 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created about 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Subscribe to a MQTT Topic or publish something quickly from the terminal

MQTT TUI

Subscribe to a MQTT Topic or publish something quickly from the terminal

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 as it has a great overview of what's going on, a small topic based history and a sorted main view. But having it running its eating up a lot of resources.

Publish something quickly from command line is also not that fun. The feature rich CLI alternative 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.

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.

Features

Terminal UI

Screenshot of the interactive terminal UI

# 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

mqttui publish "hello" "world"

mqttui publish --retain "foo/bar" "Banana?"

# More arguments and details
mqttui publish --help

Log to stdout

$ mqttui log "espHome-co2/sensor/#" "espHome-test/sensor/temperature/state"
RETAINED     espHome-co2/sensor/rssi/state                      QoS:AtMostOnce  Payload(  6): -80.09
RETAINED     espHome-co2/sensor/co2/state                       QoS:AtMostOnce  Payload(  5): 450.8
RETAINED     espHome-co2/sensor/temperature/state               QoS:AtMostOnce  Payload(  6): 22.129
RETAINED     espHome-co2/sensor/humidity/state                  QoS:AtMostOnce  Payload(  5): 25.18
RETAINED     espHome-test/sensor/temperature/state              QoS:AtMostOnce  Payload(  6): 10.339
12:10:06.650 espHome-test/sensor/temperature/state              QoS:AtMostOnce  Payload(  6): 10.454
12:10:39.606 espHome-co2/sensor/co2/state                       QoS:AtMostOnce  Payload(  5): 432.5
12:10:53.860 espHome-co2/sensor/temperature/state               QoS:AtMostOnce  Payload(  6): 21.974
12:12:06.644 espHome-test/sensor/temperature/state              QoS:AtMostOnce  Payload(  6): 10.536
12:12:39.556 espHome-co2/sensor/co2/state                       QoS:AtMostOnce  Payload(  5): 404.3
12:12:53.859 espHome-co2/sensor/temperature/state               QoS:AtMostOnce  Payload(  6): 21.921
12:13:20.146 espHome-co2/sensor/humidity/state                  QoS:AtMostOnce  Payload(  5): 25.11
12:13:27.906 espHome-co2/sensor/rssi/state                      QoS:AtMostOnce  Payload(  6): -79.81
12:14:06.643 espHome-test/sensor/temperature/state              QoS:AtMostOnce  Payload(  6): 10.568
# Subscribe to topic
mqttui log "topic"

# Multiple topics
mqttui log "topic1" "topic2"

# More arguments and details
mqttui log --help

Read a single payload to stdout

In scripts, it's helpful to get the current payload of a specific topic.

# Print the first received message to stdout and the topic to stderr
mqttui read-one room/temp

# Save the payload to a bash variable to use it
temp=$(mqttui read-one room/temp)
echo "The temperature is $temp right now"

# Wait for a non retained message (default when there is none)
temp=$(mqttui read-one --ignore-retained room/temp)
echo "Breaking news: We just received an updated temperature of $temp"

# More arguments and details
mqttui read-one --help

Clean retained topics

Use the interactive TUI and press Delete or Backspace on a topic to clean the tree or use the subcommand.

Screenshot of the tui with the cleaning dialog open

$ mqttui publish --retain "hello" "world"

$ mqttui clean-retained "hello"
RETAINED     hello          QoS:AtLeastOnce Payload(  5): world
Cleaned 1 topics
# Clean the topic
mqttui clean-retained "topic"

# Clean the topic tree below
mqttui clean-retained "topic/#"

# More arguments and details
mqttui clean-arguments --help

Configure via environment variables

See the --help command for environment variables to be set.

Personally I have set my default broker, so I don't have to use --broker all the time:

export MQTTUI_BROKER=mqtt://pi-home.local

# Use the command without specifying the broker every time
mqttui "topic"

Install

Prebuilt

Packaging status

Arch Linux (AUR)

paru -S mqttui-bin or yay -S mqttui-bin

Homebrew (Mac or Linux)

brew install mqttui

Other

Check the Releases.

From Source

  • Clone this repository
  • cargo install --path .

Interesting Alternatives

More Repositories

1

grammy-inline-menu

Inline Menus for Telegram made simple. Successor of telegraf-inline-menu.
TypeScript
349
star
2

tui-rs-tree-widget

Tree Widget for ratatui
Rust
79
star
3

telegram-typescript-bot-template

Template for Telegram bots written in TypeScript
TypeScript
68
star
4

website-stalker

Track changes on websites via git
Rust
54
star
5

telegram-format

Format Telegram message texts with Markdown or HTML
TypeScript
45
star
6

deno-semver-redirect

Redirect Deno dependencies from semantic versions to the newest fitting version on deno.land/x
Rust
10
star
7

markdown-to-standalone-html

Create a standalone HTML file from Markdown with basic CSS
Rust
8
star
8

telegram-chat-record-bot

A Telegram Bot to record messages in a given chat for a period of time
TypeScript
7
star
9

ip-changed-telegram-message

Send a Telegram message when the public IP address changes
Rust
7
star
10

wikidata-telegram-bot

Quick Look on Wikidata Entities via Telegram
TypeScript
6
star
11

website-changed-bot

This Telegram Bot can notify you on changed website source
TypeScript
6
star
12

mqtt2influxdb

Subscribe to MQTT topics and push them to InfluxDB 1.x or v2
Rust
5
star
13

website-stalker-example

Demonstrate the website-stalker being run via github-actions
HTML
5
star
14

homebridge-fake-rgb

Fake RGB Bulb plugin for homebridge: https://github.com/nfarina/homebridge
JavaScript
5
star
15

telegraf-middleware-console-time

Quick and dirty way to see what's incoming to your Telegraf or grammY Telegram bot while developing
TypeScript
5
star
16

BastionSiegeAssistBot

This bot can help with many things in Bastion Siege. Like buildings, battles, player strength estimation, alerts, โ€ฆ
TypeScript
5
star
17

rain-brainz.de

Pictures I took displayed on a minimalist HTML & CSS only webpage
TypeScript
4
star
18

wikibase-types

Types the Wikibase / Wikidata API returns
TypeScript
4
star
19

bastion-siege-logic

Reverse engineered logic of BastionSiege, a Telegram Game
TypeScript
4
star
20

pling

Send notifications via Slack, Telegram, E-Mail, ...
Rust
3
star
21

wikidata-person-names

Set of given and last names pulled from Wikidata
TypeScript
3
star
22

esp-http-neomatrix-text

Control a Neopixel Matrix over HTTP
C++
3
star
23

hawhh.de

Inoffizielle HAW Hamburg Website mit ein paar hรคufig benutzten Links und einer Suche รผber die offizielle HAW Website
HTML
3
star
24

project-below

Quickly find or run commands in many projects
Rust
3
star
25

mpd-internetradio-destuck

Fix mpd getting stuck on internet radio when the daily disconnect happens
Rust
3
star
26

bastion-siege-clone

Clone of Bastion Siege making use of telegraf-inline-menu and Wikidata labels
TypeScript
3
star
27

resilio-sync-watch-config

Small tool to create a resilio config and watch for changes to restart the sync daemon on changes
Rust
3
star
28

update-aur-package-github-action

Update an AUR package to the given tag version
Shell
2
star
29

esp-mqtt-neopixel-clock

NodeMCU with a WS2812 Ring showing a clock
C++
2
star
30

eve

old EVE Tools - replaced by silfani-eve-tools
PHP
2
star
31

html-inline

Reads an HTML file and inlines all the images and stylesheets
Rust
2
star
32

mpdPi

This project installs MPD on the Raspberry Pi, copies the webradio playlist and starts playing. Endlessly.
Shell
2
star
33

esp-mqtt-dht

A NodeMCU with a DHT Temperature Sensor sending data over MQTT
C++
2
star
34

rell-tik-tac-toe-telegram-bot

TypeScript
2
star
35

esp-mqtt-neomatrix-text

Set color and text of an Neopixel matrix via MQTT
C++
2
star
36

home-telegram-bot

A Telegram Bot for my personal home environment
TypeScript
2
star
37

wikidata-sdk-got

Run wikidata-sdk requests from NodeJS without handling urls
TypeScript
2
star
38

u2711-hdmi-linux

Use the full resolution of the Dell Monitor U2711 over HDMI on Linux
Shell
2
star
39

rust-binary-metafile-template

Some metafiles I use within my Rust binary projects
Shell
2
star
40

space-game-telegram-bot

Telegram Bot of the untitled space-game
TypeScript
2
star
41

35c3-circuit-sticker-bot

Generate 35c3 Telegram Stickers with Bleeptracks awesome Circuit Generator
JavaScript
1
star
42

LinuxScripts

mostly installation scripts for my Arch Linux + Gnome 3 systems
Shell
1
star
43

angle-distance

Calculates the difference between two angles
TypeScript
1
star
44

esp-mqtt-neomatrix-advent

Advent Wreath with 16x16 NeoPixel Matrix controllable via MQTT
C
1
star
45

eve-kill-showoff

Show off some zKillboard Kills (EVE Online)
TypeScript
1
star
46

telegram-lock-bot

A small bot for the Telegram bot API: https://telegram.me/LockBot
TypeScript
1
star
47

eve-database-to-json

scripts to parse database tables to json files
PHP
1
star
48

sun-sets-gtk-theme

Set GTK Theme based on the sun position
Rust
1
star
49

website-stalker-github-action

Installation of the website-stalker in a Linux GitHub Action workflow
1
star
50

websocket-ledmatrix-esp

LED Matrix connected to an ESP listening to a websocket
C++
1
star
51

mqtt-smarthome

My personal "smart" home logic is (partially) realized with this MQTT helper
Rust
1
star
52

array-filter-unique

JavaScript array.filter() compatible unique filter
TypeScript
1
star
53

wikidata-misfit-bot

This Telegram bot sends you some wikidata item pictures. Find the Misfit!
TypeScript
1
star
54

silfani-eve-tools

A collection of tools to use with the great game EVE Online build with angular
TypeScript
1
star