Shell-Mode
Open MQTT CLI in an interactive shell session. The shell uses JLine for handling console input. Therefore, tab-completion, command-history, password-masking and other familiar shell features are available.
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
Alias: mqtt sh
Example
$ mqtt shell # starts the shell
mqtt> con -i myClient # connect client with identifier 'myClient'
myClient@host> pub -t test -m msg # publish the message 'msg' with the new context client
myClient@host> dis # disconnect and remove context
mqtt> ...
NOTE: A client is uniquely identified in the CLI by the hostname and the unique identifier.
Commands
Command | Explanation | Requires active client context |
---|---|---|
connect | See Connect | |
disconnect | See Disconnect | |
publish | See Publish | X |
subscribe | See Subscribe | X |
unsubscribe | See Unsubscribe | X |
switch | See Switch | |
list | See List | |
clear | See Clear | |
exit | See Exit |
Options
Logging Options
Option | Long Version | Explanation | Default |
---|---|---|---|
-l | Log to ~./mqtt-cli/logs (Configurable through ~/.mqtt-cli/config.properties). | false |
Help Options
Option | Long Version | Explanation |
---|---|---|
-h | --help | Display help message for command. |
-V | --version | Display version information of the cli. |