Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/subpop/mqttcli
A simple MQTT command-line client
https://github.com/subpop/mqttcli
Last synced: 2 months ago
JSON representation
A simple MQTT command-line client
- Host: GitHub
- URL: https://github.com/subpop/mqttcli
- Owner: subpop
- License: gpl-3.0
- Created: 2021-04-23T12:58:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-28T14:13:42.000Z (5 months ago)
- Last Synced: 2024-08-28T15:36:09.662Z (5 months ago)
- Language: Go
- Homepage:
- Size: 56.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
package `mqttcli` is a program that provides two subcommands (`pub` and `sub`)
that allow command-line level access to an MQTT broker.`sub` subscribes to a topic and prints messages received to standard output.
`pub` publishes the provided message to the provided topic. Both programs accept
flags that can be provided as a config file.## Examples
### Flags ###
* `go run ./cmd/sub -broker tcp://test.mosquitto.org:1883 -topic mqttcli/test`
* `echo hello | go run ./cmd/pub -broker tcp://test.mosquitto.org:1883 -topic mqttcli/test`### Config File ###
```
cat > sub.cfg << EOF
broker tcp://test.mosquitto.org:1883
topic mqttcli/test
EOF
go run ./cmd/sub -config sub.cfg
``````
cat > pub.cfg << EOF
broker tcp://test.mosquitto.org:1883
topic mqttcli/test
EOF
echo hello | go run ./cmd/pub -config pub.cfg
```