Utilities for Tether, a standardised MQTT+MessagePack system for inter-process communication.
This CLI utility tool, written in Rust, provides a single binary with subcommands:
playback
belowThere are always two parts to the CLI command
tether
--host
or --loglevel
receive
, send
, topics
, record
or playback
Here's an example of using the receive
subcommand but specifying some non-default details for the MQTT Broker, and a non-default topic:
tether --host 10.0.0.1 --username myUserName --password myPaSsWorD! receive --topic +/+/someSpecificPlug
The simplest installation method is using the homebrew package manager for Mac. This is currently only working for MacOS running Apple Silicon.
Simply run the following two commands:
brew tap randomstudio/tether
brew install tether
(The formula and release files are hosted at https://github.com/RandomStudio/homebrew-tether - but you don't need to know that.)
If you have the Rust toolchain installed, you can install the executable using...
cargo install tether-utils
... This has the advantage of re-compiling for your architecture automatically. The crate is published at https://crates.io/crates/tether-utils
tether receive
tether send --help
tether send
tether send --help
--message
:This will be automatically converted into a MessagePack payload if it is valid JSON. Remember to escape characters such as "
, [
, ]
, {
and }
.
Example:
tether send --message \{\"hello\":\"world\"\,\"arr\":\[1,2,3\]\}
Super useful for seeing which Agents are online, and how message topics are being parsed according to Agent Role, Agent ID and Plug Name. This utility can't see into the past (except in the case of retained messages), so keep this in mind for Agents that don't publish frequently.
tether topics
tether topics --help
tether record
tether record --help
By default, a file named recording-00000000.json
(where the numbers are a timestamp) is generated in the current directory.
tether playback
tether playback --help
If you don't specify a file with --file.path
, an included demo file (demo.json
) will be used instead. You probably want to specify a path to a real file, in most cases.
💡Tip: loop the playback infinitely by passing
--loops.infinite