Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shuza/mqtt-cli
A cli application written in Go to provide terminal interaction with EMQ
https://github.com/shuza/mqtt-cli
cli-app golang golang-tools mqtt mqtt-broker mqtt-client mqtt-protocol
Last synced: about 16 hours ago
JSON representation
A cli application written in Go to provide terminal interaction with EMQ
- Host: GitHub
- URL: https://github.com/shuza/mqtt-cli
- Owner: shuza
- License: apache-2.0
- Created: 2019-04-26T18:10:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-13T05:26:20.000Z (over 5 years ago)
- Last Synced: 2024-08-01T15:41:47.485Z (3 months ago)
- Topics: cli-app, golang, golang-tools, mqtt, mqtt-broker, mqtt-client, mqtt-protocol
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mqtt-cli
This a simple mqtt-cli application written in [Go](https://golang.org/). It has pub sub command which is suite for the shell script pipelining.# Install
If you have golang ready environment, you can easily install it
```
go get github.com/shuza/mqtt-cli
```
Or you can install using following command
```
curl -s -L https://raw.githubusercontent.com/shuza/mqtt-cli/master/install.sh | bash
```# Usage
You can set host, port, clientId, topic and qos on the Environment variables.
```
export MQTT_HOST="localhost"
export MQTT_PORT="1883"
export MQTT_CLIENT_ID="mqtt-cli"
export MQTT_TOPIC="/test/mqtt/cli"
export MQTT_QOS="1"
```
Or you can use flags to do it.| Name | Short Hand | Description |
|:----------:|:-------------:|:------------:|
| address | a | Set MQTT host address |
| port | p | Set MQTT host port |
| clientId | i | Set MQTT client ID |
| topic | t | Set MQTT topic |
| qos | q | Set MQTT service quality |
| message | m | Set MQTT message palyload |
# Sub
```
mqtt-cli sub -a "localhost" -p 1883 -t "/tmp/a"
```# Pub
```
mqtt-cli pub -a "localhost" -p 1883 -t "/tmp/a" -m "thsi is to test"
```
![Solid](https://media.giphy.com/media/JpGXXxiamqV53gqleB/giphy.gif)