{"id":15945827,"url":"https://github.com/simps/mqtt-cli","last_synced_at":"2025-06-13T05:04:48.903Z","repository":{"id":45453367,"uuid":"346213815","full_name":"simps/mqtt-cli","owner":"simps","description":"⚙️ PHPMQTT CLI Tools","archived":false,"fork":false,"pushed_at":"2022-03-03T02:37:08.000Z","size":50,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-03T11:49:11.631Z","etag":null,"topics":["mqtt","mqtt-cli","mqtt-client","mqtt3","mqtt5","php","swoole"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-10T03:00:39.000Z","updated_at":"2025-05-27T18:09:59.000Z","dependencies_parsed_at":"2022-08-04T12:30:17.961Z","dependency_job_id":null,"html_url":"https://github.com/simps/mqtt-cli","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/simps/mqtt-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simps%2Fmqtt-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simps%2Fmqtt-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simps%2Fmqtt-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simps%2Fmqtt-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simps","download_url":"https://codeload.github.com/simps/mqtt-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simps%2Fmqtt-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259584786,"owners_count":22880199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mqtt","mqtt-cli","mqtt-client","mqtt3","mqtt5","php","swoole"],"created_at":"2024-10-07T09:07:22.351Z","updated_at":"2025-06-13T05:04:48.842Z","avatar_url":"https://github.com/simps.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHPMQTT CLI\n\n```\n  ____  _   _ ____  __  __  ___ _____ _____\n |  _ \\| | | |  _ \\|  \\/  |/ _ \\_   _|_   _|\n | |_) | |_| | |_) | |\\/| | | | || |   | |\n |  __/|  _  |  __/| |  | | |_| || |   | |\n |_|   |_| |_|_|   |_|  |_|\\__\\_\\|_|   |_|\n```\n\n## Install\n\n```bash\ncomposer require simps/mqtt-cli\n```\n\n## Usage\n\n### Publish\n\n```bash\n$ php vendor/bin/mqtt publish --help\nDescription:\n  Publishing simple messages\n\nUsage:\n  publish [options]\n\nOptions:\n  -H, --host[=HOST]                        Specify the host to connect to [default: \"localhost\"]\n  -P, --port[=PORT]                        Connect to the port specified [default: 1883]\n  -t, --topic=TOPIC                        The MQTT topic on which to publish the message\n  -m, --message=MESSAGE                    Send a single message from the command line\n  -i, --id[=ID]                            The id to use for this client [default: \"\"]\n      --qos[=QOS]                          Specify the quality of service to use for the message, from 0, 1 and 2 [default: 0]\n      --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]\n  -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]\n  -u, --username[=USERNAME]                Provide a username to be used for authenticating with the broker\n  -p, --pw[=PW]                            Provide a password to be used for authenticating with the broker\n  -c, --clean-session[=CLEAN-SESSION]      Setting the 'clean session' flag [default: true]\n  -l, --level=LEVEL                        MQTT Protocol level [default: 4]\n  -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]\n      --will-topic[=WILL-TOPIC]            The topic on which to send a Will, in the event that the client disconnects unexpectedly\n      --will-message[=WILL-MESSAGE]        Specify a message that will be stored by the broker and sent out if this client disconnects unexpectedly\n      --will-qos[=WILL-QOS]                The QoS to use for the Will [default: 0]\n      --will-retain[=WILL-RETAIN]          If given, if the client disconnects unexpectedly the message sent out will be treated as a retained message [default: 0]\n  -S, --ssl[=SSL]                          Enable SSL encryption [default: false]\n      --config-path[=CONFIG-PATH]          Setting the Swoole config file path\n      --properties-path[=PROPERTIES-PATH]  Setting the Properties config file path\n  -h, --help                               Display help for the given command. When no command is given display help for the list command\n  -q, --quiet                              Do not output any message\n  -V, --version                            Display this application version\n      --ansi                               Force ANSI output\n      --no-ansi                            Disable ANSI output\n  -n, --no-interaction                     Do not ask any interactive question\n  -v|vv|vvv, --verbose                     Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nHelp:\n  An MQTT version 3.1/3.1.1/5.0 client for publishing simple messages\n```\n\n### Subscribe\n\n```bash\n$ php vendor/bin/mqtt subscribe --help\nDescription:\n  Subscribing to topics\n\nUsage:\n  subscribe [options]\n\nOptions:\n  -H, --host[=HOST]                        Specify the host to connect to [default: \"localhost\"]\n  -P, --port[=PORT]                        Connect to the port specified [default: 1883]\n  -i, --id[=ID]                            The id to use for this client [default: \"\"]\n      --qos=QOS                            Specify the quality of service to use for the message, from 0, 1 and 2 (multiple values allowed)\n  -t, --topic=TOPIC                        The MQTT topic to subscribe to (multiple values allowed)\n  -u, --username[=USERNAME]                Provide a username to be used for authenticating with the broker\n  -p, --pw[=PW]                            Provide a password to be used for authenticating with the broker\n  -c, --clean-session[=CLEAN-SESSION]      Setting the 'clean session' flag [default: true]\n  -l, --level=LEVEL                        MQTT Protocol level [default: 4]\n  -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]\n      --will-topic[=WILL-TOPIC]            The topic on which to send a Will, in the event that the client disconnects unexpectedly\n      --will-message[=WILL-MESSAGE]        Specify a message that will be stored by the broker and sent out if this client disconnects unexpectedly\n      --will-qos[=WILL-QOS]                The QoS to use for the Will [default: 0]\n      --will-retain[=WILL-RETAIN]          If given, if the client disconnects unexpectedly the message sent out will be treated as a retained message [default: 0]\n  -S, --ssl[=SSL]                          Enable SSL encryption [default: false]\n      --config-path[=CONFIG-PATH]          Setting the Swoole config file path\n      --properties-path[=PROPERTIES-PATH]  Setting the Properties config file path\n  -U, --unsubscribe[=UNSUBSCRIBE]          Topics that need to be unsubscribed (multiple values allowed)\n  -e, --event[=EVENT]                      Subscribed EventDispatcher [default: \"\"]\n  -h, --help                               Display help for the given command. When no command is given display help for the list command\n  -q, --quiet                              Do not output any message\n  -V, --version                            Display this application version\n      --ansi                               Force ANSI output\n      --no-ansi                            Disable ANSI output\n  -n, --no-interaction                     Do not ask any interactive question\n  -v|vv|vvv, --verbose                     Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nHelp:\n  An MQTT version 3.1/3.1.1/5.0 client for subscribing to topics\n```\n\n### Path\n\nThere are two config: `--config-path` and `--properties-path`, you need to specify the path to the config file.\n\n- `--config-path`\n\n```php\n// config.php\n\nreturn [\n    'open_mqtt_protocol' =\u003e true,\n    'package_max_length' =\u003e 2 * 1024 * 1024,\n];\n```\n\n- `--properties-path`\n\n```php\n// properties.php\n\nreturn [\n    'publish' =\u003e [\n        'topic_alias' =\u003e 1,\n        'message_expiry_interval' =\u003e 12,\n    ],\n    'will' =\u003e [\n        'will_delay_interval' =\u003e 60,\n        'message_expiry_interval' =\u003e 60,\n    ],\n];\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimps%2Fmqtt-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimps%2Fmqtt-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimps%2Fmqtt-cli/lists"}