PHPackages                             simps/mqtt-cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. simps/mqtt-cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

simps/mqtt-cli
==============

PHPMQTT CLI Tools

v0.2.0(4y ago)858.2k↓50%12Apache-2.0PHP

Since Mar 23Pushed 4y ago2 watchersCompare

[ Source](https://github.com/simps/mqtt-cli)[ Packagist](https://packagist.org/packages/simps/mqtt-cli)[ Fund](https://donate.qq52o.me)[ GitHub Sponsors](https://github.com/simple-swoole)[ RSS](/packages/simps-mqtt-cli/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (2)

PHPMQTT CLI
===========

[](#phpmqtt-cli)

```
  ____  _   _ ____  __  __  ___ _____ _____
 |  _ \| | | |  _ \|  \/  |/ _ \_   _|_   _|
 | |_) | |_| | |_) | |\/| | | | || |   | |
 |  __/|  _  |  __/| |  | | |_| || |   | |
 |_|   |_| |_|_|   |_|  |_|\__\_\|_|   |_|

```

Install
-------

[](#install)

```
composer require simps/mqtt-cli
```

Usage
-----

[](#usage)

### Publish

[](#publish)

```
$ php vendor/bin/mqtt publish --help
Description:
  Publishing simple messages

Usage:
  publish [options]

Options:
  -H, --host[=HOST]                        Specify the host to connect to [default: "localhost"]
  -P, --port[=PORT]                        Connect to the port specified [default: 1883]
  -t, --topic=TOPIC                        The MQTT topic on which to publish the message
  -m, --message=MESSAGE                    Send a single message from the command line
  -i, --id[=ID]                            The id to use for this client [default: ""]
      --qos[=QOS]                          Specify the quality of service to use for the message, from 0, 1 and 2 [default: 0]
      --dup[=DUP]                          If the DUP flag is set to 0, it indicates that this is the first occasion that the Client or Server has attempted to send this PUBLISH packet [default: 0]
  -r, --retain[=RETAIN]                    If the RETAIN flag is set to 1 in a PUBLISH packet sent by a Client to a Server, the Server MUST replace any existing retained message for this topic and store the Application Message [default: 0]
  -u, --username[=USERNAME]                Provide a username to be used for authenticating with the broker
  -p, --pw[=PW]                            Provide a password to be used for authenticating with the broker
  -c, --clean-session[=CLEAN-SESSION]      Setting the 'clean session' flag [default: true]
  -l, --level=LEVEL                        MQTT Protocol level [default: 4]
  -k, --keepalive[=KEEPALIVE]              The number of seconds between sending PING commands to the broker for the purposes of informing it we are still connected and functioning [default: 0]
      --will-topic[=WILL-TOPIC]            The topic on which to send a Will, in the event that the client disconnects unexpectedly
      --will-message[=WILL-MESSAGE]        Specify a message that will be stored by the broker and sent out if this client disconnects unexpectedly
      --will-qos[=WILL-QOS]                The QoS to use for the Will [default: 0]
      --will-retain[=WILL-RETAIN]          If given, if the client disconnects unexpectedly the message sent out will be treated as a retained message [default: 0]
  -S, --ssl[=SSL]                          Enable SSL encryption [default: false]
      --config-path[=CONFIG-PATH]          Setting the Swoole config file path
      --properties-path[=PROPERTIES-PATH]  Setting the Properties config file path
  -h, --help                               Display help for the given command. When no command is given display help for the list command
  -q, --quiet                              Do not output any message
  -V, --version                            Display this application version
      --ansi                               Force ANSI output
      --no-ansi                            Disable ANSI output
  -n, --no-interaction                     Do not ask any interactive question
  -v|vv|vvv, --verbose                     Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  An MQTT version 3.1/3.1.1/5.0 client for publishing simple messages
```

### Subscribe

[](#subscribe)

```
$ php vendor/bin/mqtt subscribe --help
Description:
  Subscribing to topics

Usage:
  subscribe [options]

Options:
  -H, --host[=HOST]                        Specify the host to connect to [default: "localhost"]
  -P, --port[=PORT]                        Connect to the port specified [default: 1883]
  -i, --id[=ID]                            The id to use for this client [default: ""]
      --qos=QOS                            Specify the quality of service to use for the message, from 0, 1 and 2 (multiple values allowed)
  -t, --topic=TOPIC                        The MQTT topic to subscribe to (multiple values allowed)
  -u, --username[=USERNAME]                Provide a username to be used for authenticating with the broker
  -p, --pw[=PW]                            Provide a password to be used for authenticating with the broker
  -c, --clean-session[=CLEAN-SESSION]      Setting the 'clean session' flag [default: true]
  -l, --level=LEVEL                        MQTT Protocol level [default: 4]
  -k, --keepalive[=KEEPALIVE]              The number of seconds between sending PING commands to the broker for the purposes of informing it we are still connected and functioning [default: 0]
      --will-topic[=WILL-TOPIC]            The topic on which to send a Will, in the event that the client disconnects unexpectedly
      --will-message[=WILL-MESSAGE]        Specify a message that will be stored by the broker and sent out if this client disconnects unexpectedly
      --will-qos[=WILL-QOS]                The QoS to use for the Will [default: 0]
      --will-retain[=WILL-RETAIN]          If given, if the client disconnects unexpectedly the message sent out will be treated as a retained message [default: 0]
  -S, --ssl[=SSL]                          Enable SSL encryption [default: false]
      --config-path[=CONFIG-PATH]          Setting the Swoole config file path
      --properties-path[=PROPERTIES-PATH]  Setting the Properties config file path
  -U, --unsubscribe[=UNSUBSCRIBE]          Topics that need to be unsubscribed (multiple values allowed)
  -e, --event[=EVENT]                      Subscribed EventDispatcher [default: ""]
  -h, --help                               Display help for the given command. When no command is given display help for the list command
  -q, --quiet                              Do not output any message
  -V, --version                            Display this application version
      --ansi                               Force ANSI output
      --no-ansi                            Disable ANSI output
  -n, --no-interaction                     Do not ask any interactive question
  -v|vv|vvv, --verbose                     Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  An MQTT version 3.1/3.1.1/5.0 client for subscribing to topics
```

### Path

[](#path)

There are two config: `--config-path` and `--properties-path`, you need to specify the path to the config file.

- `--config-path`

```
// config.php

return [
    'open_mqtt_protocol' => true,
    'package_max_length' => 2 * 1024 * 1024,
];
```

- `--properties-path`

```
// properties.php

return [
    'publish' => [
        'topic_alias' => 1,
        'message_expiry_interval' => 12,
    ],
    'will' => [
        'will_delay_interval' => 60,
        'message_expiry_interval' => 60,
    ],
];
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~68 days

Recently: every ~81 days

Total

6

Last Release

1538d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17615e789eec7042f64c6f4e8733421987d98fcdc4269395b42d2a7f0ae94301?d=identicon)[sy-records](/maintainers/sy-records)

---

Top Contributors

[![sy-records](https://avatars.githubusercontent.com/u/33931153?v=4)](https://github.com/sy-records "sy-records (26 commits)")

---

Tags

mqttmqtt-climqtt-clientmqtt3mqtt5phpswoolephpclientswoolecoroutinemqttsimpsmqtt\_clientmqtt\_protocolmqtt3.1mqtt5.0mqtt\_cli

### Embed Badge

![Health badge](/badges/simps-mqtt-cli/health.svg)

```
[![Health](https://phpackages.com/badges/simps-mqtt-cli/health.svg)](https://phpackages.com/packages/simps-mqtt-cli)
```

###  Alternatives

[simps/mqtt

MQTT Protocol Analysis and Coroutine Client for PHP

39351.6k9](/packages/simps-mqtt)[swlib/saber

Swoole coroutine HTTP client

985145.0k27](/packages/swlib-saber)[workerman/mqtt

22450.3k12](/packages/workerman-mqtt)[simple-swoole/simps

A simple, lightweight and high-performance PHP coroutine framework.

4798.0k3](/packages/simple-swoole-simps)[swoole/grpc

Grpc PHP Client base on Swoole Http2 Coroutine

19718.9k1](/packages/swoole-grpc)[swoole/etcd-client

Grpc PHP Client base on Swoole Http2 Coroutine

1973.2k1](/packages/swoole-etcd-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
