All Projects → hivemq → mqtt-cli

hivemq / mqtt-cli

Licence: Apache-2.0 license
MQTT CLI is a useful command line interface for connecting various MQTT clients supporting MQTT 5.0 and 3.1.1

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to mqtt-cli

eMQTT5
An embedded MQTTv5 client in C++ with minimal footprint, maximal performance
Stars: ✭ 51 (-75.83%)
Mutual labels:  mqtt-client
MQTTnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 3,309 (+1468.25%)
Mutual labels:  mqtt-client
UnrealMosquitto
A MQTT client with blueprint support for Unreal Engine 4, based on Mosquitto.
Stars: ✭ 41 (-80.57%)
Mutual labels:  mqtt-client
python-mqtt-client-shell
Python-based MQTT client command shell
Stars: ✭ 45 (-78.67%)
Mutual labels:  mqtt-client
net-mqtt-client-react
Asynchronous MQTT client built on React
Stars: ✭ 45 (-78.67%)
Mutual labels:  mqtt-client
ESP8266 WiFi v2.x
ESP8266 WiFi for OpenEVSE Version 2.x
Stars: ✭ 72 (-65.88%)
Mutual labels:  mqtt-client
StriderMqtt
A very thin MQTT client
Stars: ✭ 21 (-90.05%)
Mutual labels:  mqtt-client
nmqtt
Native Nim MQTT client library
Stars: ✭ 39 (-81.52%)
Mutual labels:  mqtt-client
Adafruit CircuitPython MiniMQTT
MQTT Client Library for CircuitPython
Stars: ✭ 51 (-75.83%)
Mutual labels:  mqtt-client
web-mqtt-client
A better MQTT API for the browser
Stars: ✭ 48 (-77.25%)
Mutual labels:  mqtt-client
homie-device
NodeJS port of Homie for IoT
Stars: ✭ 20 (-90.52%)
Mutual labels:  mqtt-client
MQTT-Board
Diagnostic-oriented MQTT client tool. Supports MQTT 5.0 and 3.1.X protocols, connections to multiple brokers, MQTT operations logs and multiple subscribe widgets with unique/history topic filtering mode. Saves configuration in browser's local cache.
Stars: ✭ 81 (-61.61%)
Mutual labels:  mqtt-client
mica-mqtt
基于 java aio 实现的低延迟、高性能百万级 mqtt client 组件和 mqtt broker 服务。🔝🔝 记得右上角点个star 关注更新!
Stars: ✭ 128 (-39.34%)
Mutual labels:  mqtt-client
flutter im demo
📞 Flutter 使用 MQTT实现IM功能
Stars: ✭ 81 (-61.61%)
Mutual labels:  mqtt-client
owlos
DIY Open Source OS for building IoT ecosystems
Stars: ✭ 43 (-79.62%)
Mutual labels:  mqtt-client
Android-MQTT-Demo
An android application to demonstrate the complete MQTT lifecycle.
Stars: ✭ 31 (-85.31%)
Mutual labels:  mqtt-client
hfeasy
HFeasy - firmware for HF-LPx100/LPx30 based devices
Stars: ✭ 35 (-83.41%)
Mutual labels:  mqtt-client
swift-mqtt
MQTT client for Swift using SwiftNIO
Stars: ✭ 33 (-84.36%)
Mutual labels:  mqtt-client
swift-nio-mqtt
MQTT v5.0 client powered by SwiftNIO.
Stars: ✭ 23 (-89.1%)
Mutual labels:  mqtt-client
tuya-home-assistant
Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
Stars: ✭ 684 (+224.17%)
Mutual labels:  mqtt-client

MQTT Command Line Interface

GitHub Release GitHub Workflow Status (branch) CLI Downloads CLI License MQTT Client picocli

MQTT 5.0 and 3.1.1 compatible and feature-rich MQTT Command Line Interface

Documentation

A detailed documentation can be found here

Features

  • All MQTT 3.1.1 and MQTT 5.0 features are supported
  • interactive, direct and verbose Mode for all MQTT Commands
  • Shell behavior with Syntax Highlighting, Command completion and history
  • Configurable default settings
  • Ability to connect various MQTT Clients to different brokers simultaneously
  • Quick broker tests
  • Export information from HiveMQ API endpoints
  • Various distributions available

Prerequisites

At least Java 8 is required to run MqttCLI.

Quickstart

The simplest way to start the MQTT CLI is typing:

$ mqtt

See also:

mqtt --help.

Download latest MQTT CLI package

Packages for Linux, Mac OS and Windows can be found here: Installation/Packages!

Building from source

To do a clean build, issue the following command:

$ ./gradlew clean build This runs the unit tests and compiles a new mqtt-cli-.jar into build/libs. You can then update an existing MQTT CLI installation by replacing its mqtt-cli-.jar with this one.

The build.gradle file contains further instructions for building the platform specific distribution packages. In a nutshell:

For MacOS/Linux brew: $ ./gradlew buildBrewFormula

For the Debian package: $ ./gradlew buildDebianPackage

For the RPM package: $ ./gradlew buildRpmPackage

For the Windows installer: $ ./gradlew buildWindowsZip

Subscribe

Command Explanation
mqtt sub -t topic Subscribe to a topic on default settings and block the console.
mqtt sub -t test1 -t test2 Subscribe to the topics test1 and test2 on default settings and block the console.
mqtt sub -t test -h localhost -p 1884 Subscribe to topic test at localhost:1884.

See also mqtt sub --help

Publish

Command Explanation
mqtt pub -t test -m "Hello" Publish the message "Hello" to the test topics with the default settings
mqtt pub -t test1 -t test2 -m "Hello Tests" Publish the message "Hello Tests" on both test topics with the default settings
mqtt pub -t test -m "Hello" -h localhost -p 1884 Publish the message "Hello" on localhost:1884

See also mqtt pub --help

Shell

  • If interacting with several clients, using different contexts and publishing and subscribing with them in various ways, the shell mode with further sub commands is useful.

$ mqtt shell

The Shell-Mode is based around a client context driven use case. Therefore methods like Connect and Disconnect switch the current context of the shell and commands like Publish and Subscribe always relate to the currently active client context.

mqtt shell                # starts the shell

mqtt> con -i myClient           # connect client with identifier
myClient> pub -t test -m msg    # publish with new context client
myClient> dis                   # disconnect and remove context
mqtt> ...

In Shell-Mode the following Commands are available without an active context:

Commands

  • con, connect Connect an MQTT client
  • dis, disconnect Disconnect an MQTT client
  • switch Switch the current context
  • ls List all connected clients with their respective identifiers
  • cls, clear Clear the screen
  • exit

When connected you are switched to the context mode. In context mode all MQTT commands relate to the currently active client.

The following Commands are available with an active context:

Commands:

  • pub, publish Publish a message to a list of topics
  • sub, subscribe Subscribe this MQTT client to a list of topics
  • unsub, unsubscribe Unsubscribe this MQTT client from a list of topics
  • dis, disconnect Disconnect this MQTT client
  • switch Switch the current context
  • ls, list List all connected clients with their respective identifieres
  • cls, clear Clear the screen
  • exit Exit the current context

Test

The test command runs various tests against the specified broker to find out its features and limitations. By default the test command will use MQTT 3 clients to test the broker first and will afterwards check the connect restrictions returned by a connect of a MQTT 5 client. You can alter this behavior by specifying different options when using the command.

Test the public HiveMQ broker:

$ mqtt test -h broker.hivemq.com
MQTT 3: OK
        - Maximum topic length: 65535 bytes
        - QoS 0: Received 10/10 publishes in 25,74ms
        - QoS 1: Received 10/10 publishes in 26,27ms
        - QoS 2: Received 10/10 publishes in 70,01ms
        - Retain: OK
        - Wildcard subscriptions: OK
        - Shared subscriptions: OK
        - Payload size: >= 100000 bytes
        - Maximum client id length: 65535 bytes
        - Unsupported Ascii Chars: ALL SUPPORTED
MQTT 5: OK
        - Connect restrictions: 
                > Retain: OK
                > Wildcard subscriptions: OK
                > Shared subscriptions: OK
                > Subscription identifiers: OK
                > Maximum QoS: 2
                > Receive maximum: 10
                > Maximum packet size: 268435460 bytes
                > Topic alias maximum: 5
                > Session expiry interval: Client-based
                > Server keep alive: Client-based

HiveMQ

The HiveMQ command line argument offers various HiveMQ specific commands.

Show all available commands:

$ mqtt hivemq

The export command of the HiveMQ command line offers a set of commands to export various resources from a HiveMQ API endpoint.

$ mqtt hivemq export

Export client details from a HiveMQ node via the export clients command.

$ mqtt hivemq export clients

Please refer to the detailed documentation MQTT CLI Documentation for more examples and complete command descriptions.

Versioning

Semantic Versioning is used.

Contributing

See CONTRIBUTING.md

License

See LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].