mqttui-read-one(1)
πΈ NAME πΈ
okay so <pink>mqttui-read-one</pink> β yes bestie, that's the manual name, and it's from the General Commands Manual β is the command that waits for the first message on the topic(s) you give it and hands you its payload on stdout. Obsessed π
β¨ SYNOPSIS β¨
mqttui read-one [-r|--ignore-retained] [--only] [-p|--pretty] [--qos]
[-b|--broker] [-u|--username] [--password] [-i|--client-id] [--ca-cert]
[--client-cert] [--client-private-key] [--insecure] [-h|--help] [TOPIC]
π¦ DESCRIPTION π¦
Wait for the first message on the given topic(s) and return its payload to stdout.
It gives you exactly one payload: the first received message on the given topic(s). The topic of that received message is printed to stderr. This means that you can handle stdout and stderr separately β it's giving clean pipes, bestie π
This can be helpful for scripting to get the current temperature reading and pipe it to somewhere else:
echo "The temperature is $(mqttui read-one room/temp)"
The output is the exact payload in its binary form. This might be valid ASCII / Unicode but could also be something not intended to be displayed on a terminal. For a human readable format use --pretty or mqttui log. No cap.
π OPTIONS π
-r,--ignore-retainedβ Do not return on a retained message on connection, wait for another message to arrive. Heads up: will be removed in the future in favor of--only=live.--only <ONLY>β Only return a specific kind of message, either explicitly a retained one or one that is a current one, not stored on the broker. Keep in mind that when requesting only a retained message and there is none, this will only get noticed when the first non-retained message arrives. So this might take a while. When there is no retained message the process exits with the exit code1. Possible values:retainedlive
-p,--prettyβ Parse the payload and print it in a human readable pretty form. This might not be useful for piping the data.--qos <LEVEL> [default: 2]β Maximum Quality of Service (QoS) for subscriptions and publishing. The lower Quality of Service level for publisher and subscriber is delivered from broker to subscriber. So subscribing with0will never receive a1or2. Publishing with2will be received as1when subscribed with1.0: at most once (fire and forget)1: at least once (acknowledged delivery with potential duplicates)2: exactly once (assured delivery without duplicates) May also be specified with theMQTTUI_QOSenvironment variable.
-h,--helpβ Print help (see a summary with '-h').[TOPIC] [default: #]β Topics to watch. May also be specified with theMQTTUI_TOPICenvironment variable.
π MQTT CONNECTION π
-b,--broker <URL> [default: mqtt://localhost]β URL which represents how to connect to the MQTT broker. Examples:mqtt://localhostmqtt://localhost:1883mqtts://localhostmqtts://localhost:8883ws://localhost/pathws://localhost:9001/pathwss://localhost/pathwss://localhost:9001/pathMay also be specified with theMQTTUI_BROKERenvironment variable.-u,--username <STRING>β Username to access the mqtt broker. Anonymous access when not supplied. May also be specified with theMQTTUI_USERNAMEenvironment variable.--password <STRING>β Password to access the mqtt broker. Consider using a connection with TLS to the broker. Otherwise the password will be transported in plaintext. Passing the password via command line is insecure as the password can be read from the history! You should pass it via environment variable. π May also be specified with theMQTTUI_PASSWORDenvironment variable.-i,--client-id <STRING>β Specify the client id to connect with. May also be specified with theMQTTUI_CLIENTIDenvironment variable.--ca-cert <FILEPATH>β Path to a trusted CA certificate PEM file for verifying the broker. The CA certificate has to be a X.509 v3 certificate since rustls does not support the less secure v1 certificates. See:https://github.com/rustls/rustls/issues/2364May also be specified with theMQTTUI_CA_CERTIFICATEenvironment variable.--client-cert <FILEPATH>β Path to the TLS client certificate file. Used together with--client-private-keyto enable TLS client authentication. The file has to be a DER-encoded X.509 certificate serialized to PEM. May also be specified with theMQTTUI_CLIENT_CERTIFICATEenvironment variable.--client-private-key <FILEPATH>β Path to the TLS client private key file. Used together with--client-certto enable TLS client authentication. The file has to be a DER-encoded ASN.1 file in PKCS#8 form serialized to PEM. May also be specified with theMQTTUI_CLIENT_PRIVATE_KEYenvironment variable.--insecureβ Allow insecure TLS connections.
okay that's the whole mqttui-read-one(1) page from the read-one manual, bestie β the footer showed read-one / mqttui-read-one(1) and no date, so I'm not inventing one. Now go get that first message and slay πβ¨π¦
π¦ where this page comes from
- arch rolling: mqttui 0.24.0-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms