diff --git a/cli/README-CN.md b/cli/README-CN.md index 6c41d8611..fb126b044 100644 --- a/cli/README-CN.md +++ b/cli/README-CN.md @@ -35,14 +35,14 @@ #### Intel Chip ```shell -curl -LO https://www.emqx.com/zh/downloads/MQTTX/v1.8.2/mqttx-cli-macos-x64 +curl -LO https://www.emqx.com/zh/downloads/MQTTX/v1.8.3/mqttx-cli-macos-x64 sudo install ./mqttx-cli-macos-x64 /usr/local/bin/mqttx ``` #### Apple Silicon ```shell -curl -LO https://www.emqx.com/zh/downloads/MQTTX/v1.8.2/mqttx-cli-macos-arm64 +curl -LO https://www.emqx.com/zh/downloads/MQTTX/v1.8.3/mqttx-cli-macos-arm64 sudo install ./mqttx-cli-macos-arm64 /usr/local/bin/mqttx ``` @@ -61,14 +61,14 @@ brew install emqx/mqttx/mqttx-cli #### x86-64 ```shell -curl -LO https://www.emqx.com/zh/downloads/MQTTX/v1.8.2/mqttx-cli-linux-x64 +curl -LO https://www.emqx.com/zh/downloads/MQTTX/v1.8.3/mqttx-cli-linux-x64 sudo install ./mqttx-cli-linux-x64 /usr/local/bin/mqttx ``` #### ARM64 ```shell -curl -LO https://www.emqx.com/zh/downloads/MQTTX/v1.8.2/mqttx-cli-linux-arm64 +curl -LO https://www.emqx.com/zh/downloads/MQTTX/v1.8.3/mqttx-cli-linux-arm64 sudo install ./mqttx-cli-linux-arm64 /usr/local/bin/mqttx ``` @@ -142,27 +142,40 @@ mqttx --help mqttx conn --help ``` -| 参数 | 描述 | -| ------------------------------------------ | ---------------------------------------------- | -| -V, --mqtt-version <5/3.1.1/3.1> | MQTT 版本,默认为 5 | -| -h, --hostname | MQTT Broker 的 Host 地址,默认为 localhost | -| -p, --port | MQTT Broker 的端口号 | -| -i, --client-id | 客户端 ID | -| --no-clean | 取消 clean session 标志位,默认为 true | -| -k, --keepalive | MQTT 的 Keep Alive,默认为 30 | -| -u, --username | 连接到 MQTT Broker 的用户名 | -| -P, --password | 连接到 MQTT Broker 的密码 | -| -l, --protocol | 连接时的协议,mqtt 或 mqtts,默认为 mqtt | -| --key | key 文件的路径 | -| --cert | cert 文件的路径 | -| --ca | ca 证书的文件路径 | -| --insecure | 取消服务器的证书校验 | -| -up, --user-properties | MQTT 5.0 用户属性,例如:-up "name: mqttx cli" | -| --will-topic | 遗嘱消息的 topic | -| --will-message | 遗嘱消息的 payload | -| --will-qos <0/1/2> | 遗嘱消息的 QoS | -| --will-retain | 遗嘱消息的 retain 标志位 | -| --help | 展示 conn 命令的帮助信息 | +| 参数 | 描述 | +| ------------------------------------------------ | ---------------------------------------------- | +| -V, --mqtt-version <5/3.1.1/3.1> | MQTT 版本,默认为 5 | +| -h, --hostname | MQTT Broker 的 Host 地址,默认为 localhost | +| -p, --port | MQTT Broker 的端口号 | +| -i, --client-id | 客户端 ID | +| --no-clean | 取消 clean session 标志位,默认为 true | +| -k, --keepalive | MQTT 的 Keep Alive,默认为 30 | +| -u, --username | 连接到 MQTT Broker 的用户名 | +| -P, --password | 连接到 MQTT Broker 的密码 | +| -l, --protocol | 连接时的协议,mqtt 或 mqtts,默认为 mqtt | +| --key | key 文件的路径 | +| --cert | cert 文件的路径 | +| --ca | ca 证书的文件路径 | +| --insecure | 取消服务器的证书校验 | +| -up, --user-properties | MQTT 5.0 用户属性,例如:-up "name: mqttx cli" | +| -Wt, --will-topic | 遗嘱消息的 Topic | +| -Wm, --will-message | 遗嘱消息的 Payload | +| -Wq, --will-qos <0/1/2> | 遗嘱消息的 QoS | +| -Wr, --will-retain | 发送的遗嘱消息为保留消息,默认为 false | +| -Wd, --will-delay-interval | 遗嘱消息延迟间隔,单位为秒 | +| -Wpf, --will-payload-format-indicator | 遗嘱消息是否为UTF-8编码的字符数据 | +| -We, --will-message-expiry-interval | 遗嘱信息的有效期,单位为秒 | +| -Wct, --will-content-type | 遗嘱消息内容的描述 | +| -Wrt, --will-response-topic | 响应信息的主题名称 | +| -Wcd, --will-correlation-data | 响应信息的关联数据 | +| -Wup, --will-user-properties | 遗嘱消息的自定义用户属性 | +| -se, --session-expiry-interval | 会话过期间隔,单位为秒 | +| --rcv-max, --receive-maximum | 接收消息的最大值 | +| --maximum-packet-size | 客户端愿意接受的最大数据包大小 | +| --topic-alias-maximum | 主题别名的最大值 | +| --req-response-info | 客户端要求服务器提供的响应信息 | +| --no-req-problem-info | 客户端向服务器请求问题信息 | +| --help | 展示 conn 命令的帮助信息 | #### 订阅 @@ -191,11 +204,25 @@ mqttx sub --help | --ca | ca 证书的文件路径 | | --insecure | 取消服务器的证书校验 | | -up, --user-properties | MQTT 5.0 用户属性,例如:-up "name: mqttx cli" | -| --will-topic | 遗嘱消息的 topic | -| --will-message | 遗嘱消息的 payload | -| --will-qos <0/1/2> | 遗嘱消息的 QoS | -| --will-retain | 遗嘱消息的 retain 标志位 | | -v, --verbose | 在接收到的 Payload 前显示当前 Topic | +| -Wt, --will-topic | 遗嘱消息的 Topic | +| -Wm, --will-message | 遗嘱消息的 Payload | +| -Wq, --will-qos <0/1/2> | 遗嘱消息的 QoS | +| -Wr, --will-retain | 发送的遗嘱消息为保留消息,默认为 false | +| -Wd, --will-delay-interval | 遗嘱消息延迟间隔,单位为秒 | +| -Wpf, --will-payload-format-indicator | 遗嘱消息是否为UTF-8编码的字符数据 | +| -We, --will-message-expiry-interval | 遗嘱信息的有效期,单位为秒 | +| -Wct, --will-content-type | 遗嘱消息内容的描述 | +| -Wrt, --will-response-topic | 响应信息的主题名称 | +| -Wcd, --will-correlation-data | 响应信息的关联数据 | +| -Wup, --will-user-properties | 遗嘱消息的自定义用户属性 | +| -se, --session-expiry-interval | 会话过期间隔,单位为秒 | +| --rcv-max, --receive-maximum | 接收消息的最大值 | +| --maximum-packet-size | 客户端愿意接受的最大数据包大小 | +| --topic-alias-maximum | 主题别名的最大值 | +| --req-response-info | 客户端要求服务器提供的响应信息 | +| --no-req-problem-info | 客户端向服务器请求问题信息 | +| -Cup, --conn-user-properties | MQTT 5.0 的连接用户属性(例如,-Cup "name: mqttx cli") | | --help | 展示 sub 命令的帮助信息 | #### 发布 @@ -204,31 +231,52 @@ mqttx sub --help mqttx pub --help ``` -| 参数 | 描述 | -| ------------------------------------------ | ---------------------------------------------- | -| -V, --mqtt-version <5/3.1.1/3.1> | MQTT 版本,默认为 5 | -| -h, --hostname | MQTT Broker 的 Host 地址,默认为 localhost | -| -p, --port | MQTT Broker 的端口号 | -| -i, --client-id | 客户端 ID | -| -q, --qos <0/1/2> | 消息的 QoS,默认为 0 | -| -t, --topic | 需要发布的 Topic | -| -m, --message | 需要发布的 Payload 消息 | -| -r, --retain | 设置发送消息为 Retain 消息,默认为 fasle | -| -s, --stdin | 从 stdin 中读取信息体 | -| -M, --multiline | 可以通过多行发布多条消息 | -| -u, --username | 连接到 MQTT Broker 的用户名 | -| -P, --password | 连接到 MQTT Broker 的密码 | -| -l, --protocol | 连接时的协议,mqtt 或 mqtts,默认为 mqtt | -| --key | key 文件的路径 | -| --cert | cert 文件的路径 | -| --ca | ca 证书的文件路径 | -| --insecure | 取消服务器的证书校验 | -| -up, --user-properties | MQTT 5.0 用户属性,例如:-up "name: mqttx cli" | -| --will-topic | 遗嘱消息的 topic | -| --will-message | 遗嘱消息的 payload | -| --will-qos <0/1/2> | 遗嘱消息的 QoS | -| --will-retain | 遗嘱消息的 retain 标志位 | -| --help | 展示 pub 命令的帮助信息 | +| 参数 | 描述 | +| ------------------------------------------------ | ------------------------------------------------------------ | +| -V, --mqtt-version <5/3.1.1/3.1> | MQTT 版本,默认为 5 | +| -h, --hostname | MQTT Broker 的 Host 地址,默认为 localhost | +| -p, --port | MQTT Broker 的端口号 | +| -i, --client-id | 客户端 ID | +| -q, --qos <0/1/2> | 消息的 QoS,默认为 0 | +| -t, --topic | 需要发布的 Topic | +| -m, --message | 需要发布的 Payload 消息 | +| -r, --retain | 设置发送消息为 Retain 消息,默认为 fasle | +| -s, --stdin | 从 stdin 中读取信息体 | +| -M, --multiline | 可以通过多行发布多条消息 | +| -u, --username | 连接到 MQTT Broker 的用户名 | +| -P, --password | 连接到 MQTT Broker 的密码 | +| -l, --protocol | 连接时的协议,mqtt 或 mqtts,默认为 mqtt | +| --key | key 文件的路径 | +| --cert | cert 文件的路径 | +| --ca | ca 证书的文件路径 | +| --insecure | 取消服务器的证书校验 | +| -up, --user-properties | MQTT 5.0 用户属性,例如:-up "name: mqttx cli" | +| -pf, --payload-format-indicator | 发布信息的有效载荷格式指标 | +| -e, --message-expiry-interval | 发布信息的有效期,单位为秒 | +| -ta, --topic-alias | 主题别名,识别主题的值,而不是使用主题名称 | +| -rt, --response-topic | 作为响应信息的主题名称 | +| -cd, --correlation-data | 请求信息的发送者在收到响应信息时用来识别是哪个请求的对比数据 | +| -si, --subscription-identifier | 订阅标识符 | +| -ct, --content-type | 对发布信息内容的描述 | +| -Wt, --will-topic | 遗嘱消息的 Topic | +| -Wm, --will-message | 遗嘱消息的 Payload | +| -Wq, --will-qos <0/1/2> | 遗嘱消息的 QoS | +| -Wr, --will-retain | 发送的遗嘱消息为保留消息,默认为 false | +| -Wd, --will-delay-interval | 遗嘱消息延迟间隔,单位为秒 | +| -Wpf, --will-payload-format-indicator | 遗嘱消息是否为UTF-8编码的字符数据 | +| -We, --will-message-expiry-interval | 遗嘱信息的有效期,单位为秒 | +| -Wct, --will-content-type | 遗嘱消息内容的描述 | +| -Wrt, --will-response-topic | 响应信息的主题名称 | +| -Wcd, --will-correlation-data | 响应信息的关联数据 | +| -Wup, --will-user-properties | 遗嘱消息的自定义用户属性 | +| -se, --session-expiry-interval | 会话过期间隔,单位为秒 | +| --rcv-max, --receive-maximum | 接收消息的最大值 | +| --maximum-packet-size | 客户端愿意接受的最大数据包大小 | +| --topic-alias-maximum | 主题别名的最大值 | +| --req-response-info | 客户端要求服务器提供的响应信息 | +| --no-req-problem-info | 客户端向服务器请求问题信息 | +| -Cup, --conn-user-properties | MQTT 5.0 的连接用户属性(例如,-Cup "name: mqttx cli") | +| --help | 展示 pub 命令的帮助信息 | ## 与 EMQX 更好的合作 diff --git a/cli/README.md b/cli/README.md index 19650fe95..fc3b1f795 100644 --- a/cli/README.md +++ b/cli/README.md @@ -34,14 +34,14 @@ To install the latest MQTTX CLI stable release on **macOS** using **binary downl #### Intel Chip ```shell -curl -LO https://www.emqx.com/en/downloads/MQTTX/v1.8.2/mqttx-cli-macos-x64 +curl -LO https://www.emqx.com/en/downloads/MQTTX/v1.8.3/mqttx-cli-macos-x64 sudo install ./mqttx-cli-macos-x64 /usr/local/bin/mqttx ``` #### Apple Silicon ```shell -curl -LO https://www.emqx.com/en/downloads/MQTTX/v1.8.2/mqttx-cli-macos-arm64 +curl -LO https://www.emqx.com/en/downloads/MQTTX/v1.8.3/mqttx-cli-macos-arm64 sudo install ./mqttx-cli-macos-arm64 /usr/local/bin/mqttx ``` @@ -60,14 +60,14 @@ To install the latest MQTTX CLI stable release on **Linux** using **binary downl #### x86-64 ```shell -curl -LO https://www.emqx.com/en/downloads/MQTTX/v1.8.2/mqttx-cli-linux-x64 +curl -LO https://www.emqx.com/en/downloads/MQTTX/v1.8.3/mqttx-cli-linux-x64 sudo install ./mqttx-cli-linux-x64 /usr/local/bin/mqttx ``` #### ARM64 ```shell -curl -LO https://www.emqx.com/en/downloads/MQTTX/v1.8.2/mqttx-cli-linux-arm64 +curl -LO https://www.emqx.com/en/downloads/MQTTX/v1.8.3/mqttx-cli-linux-arm64 sudo install ./mqttx-cli-linux-arm64 /usr/local/bin/mqttx ``` @@ -125,8 +125,8 @@ mqttx --help | Options | Description | | ------------- | ------------------------- | -| -v, --version | output the version number | -| -h, --help | display help for command | +| -v, --version | Output the version number | +| -h, --help | Display help for command | | Command | Description | | ------- | ---------------------------------------------- | @@ -141,27 +141,40 @@ mqttx --help mqttx conn --help ``` -| Options | Description | -| ------------------------------------------ | ------------------------------------------------------------ | -| -V, --mqtt-version <5/3.1.1/3.1> | the MQTT version (default: 5) | -| -h, --hostname | the broker host (default: "localhost") | -| -p, --port | the broker port | -| -i, --client-id | the client id | -| --no-clean | set the clean session flag to false (default: true) | -| -k, --keepalive | send a ping every SEC seconds (default: 30) | -| -u, --username | the username | -| -P, --password | the password | -| -l, --protocol | the protocol to use, mqtt or mqtts (default: mqtt) | -| --key | path to the key file | -| --cert | path to the cert file | -| --ca | path to the ca certificate | -| --insecure | do not verify the server certificate | -| -up, --user-properties | the user properties of MQTT 5.0 (e.g. -up "name: mqttx cli") | -| --will-topic | the will topic | -| --will-message | the will message | -| --will-qos <0/1/2> | the will qos | -| --will-retain | send a will retained message (default: false) | -| --help | display help for conn command | +| Options | Description | +| ------------------------------------------------ | ------------------------------------------------------------ | +| -V, --mqtt-version <5/3.1.1/3.1> | the MQTT version (default: 5) | +| -h, --hostname | the broker host (default: "localhost") | +| -p, --port | the broker port | +| -i, --client-id | the client id | +| --no-clean | set the clean session flag to false (default: true) | +| -k, --keepalive | send a ping every SEC seconds (default: 30) | +| -u, --username | the username | +| -P, --password | the password | +| -l, --protocol | the protocol to use, mqtt or mqtts (default: mqtt) | +| --key | path to the key file | +| --cert | path to the cert file | +| --ca | path to the ca certificate | +| --insecure | do not verify the server certificate | +| -up, --user-properties | the user properties of MQTT 5.0 (e.g. -up "name: mqttx cli") | +| -Wt, --will-topic | the will topic | +| -Wm, --will-message | the will message | +| -Wq, --will-qos <0/1/2> | the will qos | +| -Wr, --will-retain | send a will retained message (default: false) | +| -Wd, --will-delay-interval | the will delay interval in seconds | +| -Wpf, --will-payload-format-indicator | will message is UTF-8 encoded character data or not | +| -We, --will-message-expiry-interval | lifetime of the will message in seconds | +| -Wct, --will-content-type | description of the will message’s content | +| -Wrt, --will-response-topic | topic name for a response message | +| -Wcd, --will-correlation-data | correlation data for the response message | +| -Wup, --will-user-properties | the user properties of will message | +| -se, --session-expiry-interval | the session expiry interval in seconds | +| --rcv-max, --receive-maximum | the receive maximum value | +| --maximum-packet-size | the maximum packet size the client is willing to accept | +| --topic-alias-maximum | the topic alias maximum value | +| --req-response-info | the client requests response information from the server | +| --no-req-problem-info | the client requests problem information from the server | +| --help | display help for conn command | #### Subscribe @@ -190,11 +203,25 @@ mqttx sub --help | --ca | path to the ca certificate | | --insecure | do not verify the server certificate | | -up, --user-properties | the user properties of MQTT 5.0 (e.g. -up "name: mqttx cli") | -| --will-topic | the will topic | -| --will-message | the will message | -| --will-qos <0/1/2> | the will qos | -| --will-retain | send a will retained message (default: false) | | -v, --verbose | print the topic before the message | +| -Wt, --will-topic | the will topic | +| -Wm, --will-message | the will message | +| -Wq, --will-qos <0/1/2> | the will qos | +| -Wr, --will-retain | send a will retained message (default: false) | +| -Wd, --will-delay-interval | the will delay interval in seconds | +| -Wpf, --will-payload-format-indicator | will message is UTF-8 encoded character data or not | +| -We, --will-message-expiry-interval | lifetime of the will message in seconds | +| -Wct, --will-content-type | description of the will message’s content | +| -Wrt, --will-response-topic | topic name for a response message | +| -Wcd, --will-correlation-data | correlation data for the response message | +| -Wup, --will-user-properties | the user properties of will message | +| -se, --session-expiry-interval | the session expiry interval in seconds | +| --rcv-max, --receive-maximum | the receive maximum value | +| --maximum-packet-size | the maximum packet size the client is willing to accept | +| --topic-alias-maximum | the topic alias maximum value | +| --req-response-info | the client requests response information from the server | +| --no-req-problem-info | the client requests problem information from the server | +| -Cup, --conn-user-properties | the connect user properties of MQTT 5.0 (e.g. -Cup "name: mqttx cli") | | --help | display help for sub command | #### Publish @@ -203,31 +230,52 @@ mqttx sub --help mqttx pub --help ``` -| Options | Description | -| ------------------------------------------ | ------------------------------------------------------------ | -| -V, --mqtt-version <5/3.1.1/3.1> | the MQTT version (default: 5) | -| -h, --hostname | the broker host (default: "localhost") | -| -p, --port | the broker port | -| -i, --client-id | the client id | -| -q, --qos <0/1/2> | the QoS of the message (default: 0) | -| -t, --topic | the message topic | -| -m, --message | the message body (default: "Hello From MQTT X CLI") | -| -r, --retain | send a retained message (default: false) | -| -s, --stdin | read the message body from stdin | -| -M, --multiline | read lines from stdin as multiple messages | -| -u, --username | the username | -| -P, --password | the password | -| -l, --protocol | the protocol to use, mqtt or mqtts (default: mqtt) | -| --key | path to the key file | -| --cert | path to the cert file | -| --ca | path to the ca certificate | -| --insecure | do not verify the server certificate | -| -up, --user-properties | the user properties of MQTT 5.0 (e.g. -up "name: mqttx cli") | -| --will-topic | the will topic | -| --will-message | the will message | -| --will-qos <0/1/2> | the will qos (default: 0) | -| --will-retain | send a will retained message (default: false) | -| --help | display help for pub command | +| Options | Description | +| ------------------------------------------------ | ------------------------------------------------------------ | +| -V, --mqtt-version <5/3.1.1/3.1> | the MQTT version (default: 5) | +| -h, --hostname | the broker host (default: "localhost") | +| -p, --port | the broker port | +| -i, --client-id | the client id | +| -q, --qos <0/1/2> | the QoS of the message (default: 0) | +| -t, --topic | the message topic | +| -m, --message | the message body (default: "Hello From MQTT X CLI") | +| -r, --retain | send a retained message (default: false) | +| -s, --stdin | read the message body from stdin | +| -M, --multiline | read lines from stdin as multiple messages | +| -u, --username | the username | +| -P, --password | the password | +| -l, --protocol | the protocol to use, mqtt or mqtts (default: mqtt) | +| --key | path to the key file | +| --cert | path to the cert file | +| --ca | path to the ca certificate | +| --insecure | do not verify the server certificate | +| -up, --user-properties | the user properties of MQTT 5.0 (e.g. -up "name: mqttx cli") | +| -pf, --payload-format-indicator | the payload format indicator of the publish message | +| -e, --message-expiry-interval | the lifetime of the publish message in seconds | +| -ta, --topic-alias | value that is used to identify the topic instead of using the topic name | +| -rt, --response-topic | string which is used as the topic name for a response message | +| -cd, --correlation-data | used by the sender of the request message to identify which request the response message is for when it is received | +| -si, --subscription-identifier | the identifier of the subscription | +| -ct, --content-type | a description of the content of the publish message | +| -Wt, --will-topic | the will topic | +| -Wm, --will-message | the will message | +| -Wq, --will-qos <0/1/2> | the will qos | +| -Wr, --will-retain | send a will retained message (default: false) | +| -Wd, --will-delay-interval | the will delay interval in seconds | +| -Wpf, --will-payload-format-indicator | will message is UTF-8 encoded character data or not | +| -We, --will-message-expiry-interval | lifetime of the will message in seconds | +| -Wct, --will-content-type | description of the will message’s content | +| -Wrt, --will-response-topic | topic name for a response message | +| -Wcd, --will-correlation-data | correlation data for the response message | +| -Wup, --will-user-properties | the user properties of will message | +| -se, --session-expiry-interval | the session expiry interval in seconds | +| --rcv-max, --receive-maximum | the receive maximum value | +| --maximum-packet-size | the maximum packet size the client is willing to accept | +| --topic-alias-maximum | the topic alias maximum value | +| --req-response-info | the client requests response information from the server | +| --no-req-problem-info | the client requests problem information from the server | +| -Cup, --conn-user-properties | the connect user properties of MQTT 5.0 (e.g. -Cup "name: mqttx cli") | +| --help | display help for pub command | ## Better Together with EMQX diff --git a/cli/src/index.ts b/cli/src/index.ts index ee7fd78da..7d2286cb5 100755 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -136,7 +136,7 @@ export class Commander { .option('--no-req-problem-info', 'the client requests problem information from the server') .option( '-Cup, --conn-user-properties ', - 'the connect user properties of MQTT 5.0 (e.g. -up "name: mqttx cli")', + 'the connect user properties of MQTT 5.0 (e.g. -Cup "name: mqttx cli")', parseUserProperties, ) // will message options @@ -201,7 +201,7 @@ export class Commander { .option('--no-req-problem-info', 'the client requests problem information from the server') .option( '-Cup, --conn-user-properties ', - 'the connect user properties of MQTT 5.0 (e.g. -up "name: mqttx cli")', + 'the connect user properties of MQTT 5.0 (e.g. -Cup "name: mqttx cli")', parseUserProperties, ) // will message options