[{"data":1,"prerenderedAt":502},["Reactive",2],{"cli,faq":3,"VEb9Nnn1YX":479},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":7,"body":9,"_type":474,"_id":475,"_source":476,"_file":477,"_extension":478},"/en/cli/faq","cli",false,"","FAQ",{"type":10,"children":11,"toc":461},"root",[12,20,27,42,48,53,65,87,93,98,107,120,126,234,240,285,291,334,340,374,380,416,422,442,448],{"type":13,"tag":14,"props":15,"children":17},"element","h1",{"id":16},"faq",[18],{"type":19,"value":8},"text",{"type":13,"tag":21,"props":22,"children":24},"h2",{"id":23},"what-is-mqttx-cli",[25],{"type":19,"value":26},"What is MQTTX CLI?",{"type":13,"tag":28,"props":29,"children":30},"p",{},[31,33,40],{"type":19,"value":32},"MQTTX CLI (",{"type":13,"tag":34,"props":35,"children":37},"code",{"className":36},[],[38],{"type":19,"value":39},"mqttx",{"type":19,"value":41},") is a free, open-source (Apache-2.0) MQTT 5.0 command-line client by EMQ. It runs on Windows, macOS, and Linux and lets you connect to MQTT brokers, publish and subscribe to messages, run benchmarks, and simulate IoT data from the terminal, without a graphical interface.",{"type":13,"tag":21,"props":43,"children":45},{"id":44},"how-do-i-install-mqttx-cli",[46],{"type":19,"value":47},"How do I install MQTTX CLI?",{"type":13,"tag":28,"props":49,"children":50},{},[51],{"type":19,"value":52},"On macOS and Linux, run:",{"type":13,"tag":54,"props":55,"children":60},"pre",{"className":56,"code":58,"language":59,"meta":7},[57],"language-shell","curl -fsSL https://emqx.sh/mqttx | sh\n","shell",[61],{"type":13,"tag":34,"props":62,"children":63},{"__ignoreMap":7},[64],{"type":19,"value":58},{"type":13,"tag":28,"props":66,"children":67},{},[68,70,76,78,85],{"type":19,"value":69},"On Windows, run ",{"type":13,"tag":34,"props":71,"children":73},{"className":72},[],[74],{"type":19,"value":75},"irm https://emqx.sh/mqttx.ps1 | iex",{"type":19,"value":77}," in PowerShell. See ",{"type":13,"tag":79,"props":80,"children":82},"a",{"href":81},"/docs/cli/downloading-and-installation",[83],{"type":19,"value":84},"Installation",{"type":19,"value":86}," for Homebrew, NPM, Docker and other options.",{"type":13,"tag":21,"props":88,"children":90},{"id":89},"how-do-i-test-an-mqtt-broker-from-the-command-line",[91],{"type":19,"value":92},"How do I test an MQTT broker from the command line?",{"type":13,"tag":28,"props":94,"children":95},{},[96],{"type":19,"value":97},"Subscribe in one terminal and publish in another:",{"type":13,"tag":54,"props":99,"children":102},{"className":100,"code":101,"language":59,"meta":7},[57],"mqttx sub -t 'hello' -h 'broker.emqx.io' -p 1883\nmqttx pub -t 'hello' -h 'broker.emqx.io' -p 1883 -m 'from MQTTX CLI'\n",[103],{"type":13,"tag":34,"props":104,"children":105},{"__ignoreMap":7},[106],{"type":19,"value":101},{"type":13,"tag":28,"props":108,"children":109},{},[110,112,118],{"type":19,"value":111},"To only check that the broker accepts a connection, run ",{"type":13,"tag":34,"props":113,"children":115},{"className":114},[],[116],{"type":19,"value":117},"mqttx conn -h 'broker.emqx.io' -p 1883",{"type":19,"value":119},".",{"type":13,"tag":21,"props":121,"children":123},{"id":122},"how-do-i-connect-over-tls-or-websocket",[124],{"type":19,"value":125},"How do I connect over TLS or WebSocket?",{"type":13,"tag":28,"props":127,"children":128},{},[129,131,137,139,145,147,153,154,160,162,168,170,176,178,184,186,192,194,200,202,208,210,216,218,224,226,232],{"type":19,"value":130},"Use ",{"type":13,"tag":34,"props":132,"children":134},{"className":133},[],[135],{"type":19,"value":136},"-l, --protocol",{"type":19,"value":138}," to choose ",{"type":13,"tag":34,"props":140,"children":142},{"className":141},[],[143],{"type":19,"value":144},"mqtt",{"type":19,"value":146},", ",{"type":13,"tag":34,"props":148,"children":150},{"className":149},[],[151],{"type":19,"value":152},"mqtts",{"type":19,"value":146},{"type":13,"tag":34,"props":155,"children":157},{"className":156},[],[158],{"type":19,"value":159},"ws",{"type":19,"value":161},", or ",{"type":13,"tag":34,"props":163,"children":165},{"className":164},[],[166],{"type":19,"value":167},"wss",{"type":19,"value":169},". For TLS, pass ",{"type":13,"tag":34,"props":171,"children":173},{"className":172},[],[174],{"type":19,"value":175},"--ca",{"type":19,"value":177},", and for mutual TLS also ",{"type":13,"tag":34,"props":179,"children":181},{"className":180},[],[182],{"type":19,"value":183},"--cert",{"type":19,"value":185}," and ",{"type":13,"tag":34,"props":187,"children":189},{"className":188},[],[190],{"type":19,"value":191},"--key",{"type":19,"value":193},". Use ",{"type":13,"tag":34,"props":195,"children":197},{"className":196},[],[198],{"type":19,"value":199},"--insecure",{"type":19,"value":201}," only for testing, because it skips server certificate verification. For WebSocket, ",{"type":13,"tag":34,"props":203,"children":205},{"className":204},[],[206],{"type":19,"value":207},"--path",{"type":19,"value":209}," sets the path (default ",{"type":13,"tag":34,"props":211,"children":213},{"className":212},[],[214],{"type":19,"value":215},"/mqtt",{"type":19,"value":217},") and ",{"type":13,"tag":34,"props":219,"children":221},{"className":220},[],[222],{"type":19,"value":223},"-wh",{"type":19,"value":225}," adds headers. See ",{"type":13,"tag":79,"props":227,"children":229},{"href":228},"/docs/cli/get-started#connection",[230],{"type":19,"value":231},"Connection",{"type":19,"value":233}," for all options.",{"type":13,"tag":21,"props":235,"children":237},{"id":236},"which-mqtt-versions-does-mqttx-cli-support",[238],{"type":19,"value":239},"Which MQTT versions does MQTTX CLI support?",{"type":13,"tag":28,"props":241,"children":242},{},[243,245,251,253,259,261,267,269,275,277,283],{"type":19,"value":244},"MQTT 5.0, 3.1.1, and 3.1. MQTT 5.0 is the default; choose another version with ",{"type":13,"tag":34,"props":246,"children":248},{"className":247},[],[249],{"type":19,"value":250},"-V, --mqtt-version",{"type":19,"value":252},". MQTT 5.0 features are available as options, such as user properties (",{"type":13,"tag":34,"props":254,"children":256},{"className":255},[],[257],{"type":19,"value":258},"-up",{"type":19,"value":260},"), session expiry interval (",{"type":13,"tag":34,"props":262,"children":264},{"className":263},[],[265],{"type":19,"value":266},"-se",{"type":19,"value":268},"), and retain handling on ",{"type":13,"tag":34,"props":270,"children":272},{"className":271},[],[273],{"type":19,"value":274},"sub",{"type":19,"value":276}," (",{"type":13,"tag":34,"props":278,"children":280},{"className":279},[],[281],{"type":19,"value":282},"-rh",{"type":19,"value":284},").",{"type":13,"tag":21,"props":286,"children":288},{"id":287},"can-mqttx-cli-benchmark-an-mqtt-broker",[289],{"type":19,"value":290},"Can MQTTX CLI benchmark an MQTT broker?",{"type":13,"tag":28,"props":292,"children":293},{},[294,296,302,303,309,311,317,319,325,327,333],{"type":19,"value":295},"Yes. ",{"type":13,"tag":34,"props":297,"children":299},{"className":298},[],[300],{"type":19,"value":301},"mqttx bench conn",{"type":19,"value":146},{"type":13,"tag":34,"props":304,"children":306},{"className":305},[],[307],{"type":19,"value":308},"mqttx bench sub",{"type":19,"value":310},", and ",{"type":13,"tag":34,"props":312,"children":314},{"className":313},[],[315],{"type":19,"value":316},"mqttx bench pub",{"type":19,"value":318}," measure connection, subscribe, and publish performance with many concurrent clients, for example ",{"type":13,"tag":34,"props":320,"children":322},{"className":321},[],[323],{"type":19,"value":324},"mqttx bench pub -c 5000 -t bench/%i",{"type":19,"value":326},". See ",{"type":13,"tag":79,"props":328,"children":330},{"href":329},"/docs/cli/get-started#benchmark",[331],{"type":19,"value":332},"Benchmark",{"type":19,"value":119},{"type":13,"tag":21,"props":335,"children":337},{"id":336},"can-mqttx-cli-generate-simulated-iot-data",[338],{"type":19,"value":339},"Can MQTTX CLI generate simulated IoT data?",{"type":13,"tag":28,"props":341,"children":342},{},[343,344,350,352,358,360,366,367,373],{"type":19,"value":295},{"type":13,"tag":34,"props":345,"children":347},{"className":346},[],[348],{"type":19,"value":349},"mqttx simulate",{"type":19,"value":351}," publishes data from built-in scenarios (list them with ",{"type":13,"tag":34,"props":353,"children":355},{"className":354},[],[356],{"type":19,"value":357},"mqttx ls -sc",{"type":19,"value":359},") or from your own JavaScript scripts, for example ",{"type":13,"tag":34,"props":361,"children":363},{"className":362},[],[364],{"type":19,"value":365},"mqttx simulate -sc tesla -c 10",{"type":19,"value":326},{"type":13,"tag":79,"props":368,"children":370},{"href":369},"/docs/cli/get-started#simulate",[371],{"type":19,"value":372},"Simulate",{"type":19,"value":119},{"type":13,"tag":21,"props":375,"children":377},{"id":376},"how-do-i-avoid-retyping-the-same-options",[378],{"type":19,"value":379},"How do I avoid retyping the same options?",{"type":13,"tag":28,"props":381,"children":382},{},[383,385,391,393,399,401,407,409,415],{"type":19,"value":384},"Save options to a JSON or YAML file with ",{"type":13,"tag":34,"props":386,"children":388},{"className":387},[],[389],{"type":19,"value":390},"-so, --save-options",{"type":19,"value":392}," and load them later with ",{"type":13,"tag":34,"props":394,"children":396},{"className":395},[],[397],{"type":19,"value":398},"-lo, --load-options",{"type":19,"value":400},". Run ",{"type":13,"tag":34,"props":402,"children":404},{"className":403},[],[405],{"type":19,"value":406},"mqttx init",{"type":19,"value":408}," to create a default configuration file. See ",{"type":13,"tag":79,"props":410,"children":412},{"href":411},"/docs/cli/get-started#configuration-file",[413],{"type":19,"value":414},"Configuration File",{"type":19,"value":119},{"type":13,"tag":21,"props":417,"children":419},{"id":418},"can-ai-coding-agents-use-mqttx-cli",[420],{"type":19,"value":421},"Can AI coding agents use MQTTX CLI?",{"type":13,"tag":28,"props":423,"children":424},{},[425,427,433,435,441],{"type":19,"value":426},"Yes. The ",{"type":13,"tag":79,"props":428,"children":430},{"href":429},"/docs/cli/agent-skill",[431],{"type":19,"value":432},"mqttx-cli Agent Skill",{"type":19,"value":434}," teaches AI coding agents such as Claude Code and Cursor to run MQTTX CLI correctly for connection checks, pub/sub round trips, benchmarks, and troubleshooting. Install it with ",{"type":13,"tag":34,"props":436,"children":438},{"className":437},[],[439],{"type":19,"value":440},"npx skills add emqx/MQTTX --skill mqttx-cli",{"type":19,"value":119},{"type":13,"tag":21,"props":443,"children":445},{"id":444},"how-do-i-check-for-updates",[446],{"type":19,"value":447},"How do I check for updates?",{"type":13,"tag":28,"props":449,"children":450},{},[451,453,459],{"type":19,"value":452},"Run ",{"type":13,"tag":34,"props":454,"children":456},{"className":455},[],[457],{"type":19,"value":458},"mqttx check",{"type":19,"value":460}," to see whether a newer version of MQTTX CLI is available.",{"title":7,"searchDepth":462,"depth":462,"links":463},2,[464,465,466,467,468,469,470,471,472,473],{"id":23,"depth":462,"text":26},{"id":44,"depth":462,"text":47},{"id":89,"depth":462,"text":92},{"id":122,"depth":462,"text":125},{"id":236,"depth":462,"text":239},{"id":287,"depth":462,"text":290},{"id":336,"depth":462,"text":339},{"id":376,"depth":462,"text":379},{"id":418,"depth":462,"text":421},{"id":444,"depth":462,"text":447},"markdown","content:en:cli:faq.md","content","en/cli/faq.md","md",{"items":480,"meta":499},[481,484,487,490,493,496],{"title":482,"titleUrl":483},"MQTT QoS 0、1、2 のクイックスタート","introduction-to-mqtt-qos",{"title":485,"titleUrl":486},"MQTT TopicとWildcardの初心者向けガイド","advanced-features-of-mqtt-topics",{"title":488,"titleUrl":489},"MQTT Broker：原理、人気のオプション、クイックスタート","the-ultimate-guide-to-mqtt-broker-comparison",{"title":491,"titleUrl":492},"ESP32におけるMQTT活用入門ガイド","esp32-connects-to-the-free-public-mqtt-broker",{"title":494,"titleUrl":495},"CAN Bus：機能、利点と課題、高速ローカル処理チュートリアル","can-bus-how-it-works-pros-and-cons",{"title":497,"titleUrl":498},"Python言語の「Paho」MQTTクライアントの使用法","how-to-use-mqtt-in-python",{"count":500,"limit":500,"page":501},6,1,1793261231831]