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