[{"data":1,"prerenderedAt":475},["Reactive",2],{"VEb9Nnn1YX":3,"cli,agent-skill":26},{"items":4,"meta":23},[5,8,11,14,17,20],{"title":6,"titleUrl":7},"如何在 Python3 中使用 MQTT 客户端库 Paho Client","how-to-use-mqtt-in-python",{"title":9,"titleUrl":10},"MQTT服务器（MQTT Broker）：工作原理与快速入门指南","the-ultimate-guide-to-mqtt-broker-comparison",{"title":12,"titleUrl":13},"MQTT QoS 0、1、2 解析：快速入门指南","introduction-to-mqtt-qos",{"title":15,"titleUrl":16},"在 ESP32 上使用 MQTT：入门指南","esp32-connects-to-the-free-public-mqtt-broker",{"title":18,"titleUrl":19},"MQTT 主题与通配符（Topics & Wildcards）入门手册","advanced-features-of-mqtt-topics",{"title":21,"titleUrl":22},"车联网 CAN Bus 协议介绍与数据实时流处理","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":32,"body":33,"_type":470,"_id":471,"_source":472,"_file":473,"_extension":474},"/zh/cli/agent-skill","cli",false,"","AI Agent Skill","MQTTX CLI 内置了一个 Agent Skill，用于指导 AI 编码 Agent 正确、安全地操作 mqttx 命令。该 Skill 位于 MQTTX 仓库的 skills/mqttx-cli 目录，覆盖连接检查、消息收发、MQTT 5 功能验证、TLS 与 SCRAM 认证、编解码与 Schema、压测、数据模拟、配置和故障排查等场景。",{"type":34,"children":35,"toc":463},"root",[36,44,75,82,94,112,118,132,144,185,191,203,205,445,450,455],{"type":37,"tag":38,"props":39,"children":41},"element","h1",{"id":40},"ai-agent-skill",[42],{"type":43,"value":31},"text",{"type":37,"tag":45,"props":46,"children":47},"p",{},[48,50,57,59,73],{"type":43,"value":49},"MQTTX CLI 内置了一个 Agent Skill，用于指导 AI 编码 Agent 正确、安全地操作 ",{"type":37,"tag":51,"props":52,"children":54},"code",{"className":53},[],[55],{"type":43,"value":56},"mqttx",{"type":43,"value":58}," 命令。该 Skill 位于 MQTTX 仓库的 ",{"type":37,"tag":60,"props":61,"children":66},"a",{"href":62,"rel":63,"target":65},"https://github.com/emqx/MQTTX/tree/main/skills/mqttx-cli",[64,64],"noopener","_blank",[67],{"type":37,"tag":51,"props":68,"children":70},{"className":69},[],[71],{"type":43,"value":72},"skills/mqttx-cli",{"type":43,"value":74}," 目录，覆盖连接检查、消息收发、MQTT 5 功能验证、TLS 与 SCRAM 认证、编解码与 Schema、压测、数据模拟、配置和故障排查等场景。",{"type":37,"tag":76,"props":77,"children":79},"h2",{"id":78},"通过-agent-安装或更新-mqttx-cli",[80],{"type":43,"value":81},"通过 Agent 安装或更新 MQTTX CLI",{"type":37,"tag":45,"props":83,"children":84},{},[85,92],{"type":37,"tag":60,"props":86,"children":89},{"href":87,"rel":88,"target":65},"https://github.com/emqx/MQTTX/blob/main/INSTALL.md",[64,64],[90],{"type":43,"value":91},"INSTALL.md",{"type":43,"value":93}," 提供了面向 Agent 的安装与更新步骤，包括环境检测、安装渠道选择和版本验证。可以将下面的提示词交给 Agent：",{"type":37,"tag":95,"props":96,"children":97},"blockquote",{},[98],{"type":37,"tag":45,"props":99,"children":100},{},[101,103,110],{"type":43,"value":102},"读取 ",{"type":37,"tag":60,"props":104,"children":107},{"href":105,"rel":106,"target":65},"https://raw.githubusercontent.com/emqx/MQTTX/main/INSTALL.md%EF%BC%8C%E6%8C%89%E7%85%A7%E5%85%B6%E4%B8%AD%E7%9A%84%E6%AD%A5%E9%AA%A4%E4%B8%BA%E5%BD%93%E5%89%8D%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85%E6%88%96%E6%9B%B4%E6%96%B0",[64,64],[108],{"type":43,"value":109},"https://raw.githubusercontent.com/emqx/MQTTX/main/INSTALL.md，按照其中的步骤为当前环境安装或更新",{"type":43,"value":111}," MQTTX CLI，并验证命令路径和版本。",{"type":37,"tag":76,"props":113,"children":115},{"id":114},"安装-skill",[116],{"type":43,"value":117},"安装 Skill",{"type":37,"tag":45,"props":119,"children":120},{},[121,123,130],{"type":43,"value":122},"通过 ",{"type":37,"tag":60,"props":124,"children":127},{"href":125,"rel":126,"target":65},"https://github.com/vercel-labs/skills",[64,64],[128],{"type":43,"value":129},"Skills CLI",{"type":43,"value":131}," 安装：",{"type":37,"tag":133,"props":134,"children":139},"pre",{"className":135,"code":137,"language":138,"meta":30},[136],"language-shell","npx skills add emqx/MQTTX --skill mqttx-cli\n","shell",[140],{"type":37,"tag":51,"props":141,"children":142},{"__ignoreMap":30},[143],{"type":43,"value":137},{"type":37,"tag":45,"props":145,"children":146},{},[147,149,155,157,162,164,170,172,183],{"type":43,"value":148},"从本地源码安装时，在仓库根目录运行 ",{"type":37,"tag":51,"props":150,"children":152},{"className":151},[],[153],{"type":43,"value":154},"npx skills add . --skill mqttx-cli",{"type":43,"value":156},"。也可以将整个 ",{"type":37,"tag":51,"props":158,"children":160},{"className":159},[],[161],{"type":43,"value":72},{"type":43,"value":163}," 目录（包括 ",{"type":37,"tag":51,"props":165,"children":167},{"className":166},[],[168],{"type":43,"value":169},"references",{"type":43,"value":171},"）复制到 Agent 支持的技能目录，或让 Agent 直接读取其中的 ",{"type":37,"tag":60,"props":173,"children":176},{"href":174,"rel":175,"target":65},"https://github.com/emqx/MQTTX/blob/main/skills/mqttx-cli/SKILL.md",[64,64],[177],{"type":37,"tag":51,"props":178,"children":180},{"className":179},[],[181],{"type":43,"value":182},"SKILL.md",{"type":43,"value":184},"。",{"type":37,"tag":76,"props":186,"children":188},{"id":187},"skill-覆盖内容",[189],{"type":43,"value":190},"Skill 覆盖内容",{"type":37,"tag":45,"props":192,"children":193},{},[194,196,201],{"type":43,"value":195},"Skill 的 ",{"type":37,"tag":51,"props":197,"children":199},{"className":198},[],[200],{"type":43,"value":182},{"type":43,"value":202}," 会根据任务将 Agent 引导至对应的参考文档，Agent 只需阅读与任务相关的内容：",{"type":43,"value":204},"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",{"type":37,"tag":206,"props":207,"children":208},"table",{},[209,228],{"type":37,"tag":210,"props":211,"children":212},"thead",{},[213],{"type":37,"tag":214,"props":215,"children":216},"tr",{},[217,223],{"type":37,"tag":218,"props":219,"children":220},"th",{},[221],{"type":43,"value":222},"任务",{"type":37,"tag":218,"props":224,"children":225},{},[226],{"type":43,"value":227},"参考文档",{"type":37,"tag":229,"props":230,"children":231},"tbody",{},[232,272,290,308,326,378,409,427],{"type":37,"tag":214,"props":233,"children":234},{},[235,262],{"type":37,"tag":236,"props":237,"children":238},"td",{},[239,245,247,253,254,260],{"type":37,"tag":51,"props":240,"children":242},{"className":241},[],[243],{"type":43,"value":244},"conn",{"type":43,"value":246},"、",{"type":37,"tag":51,"props":248,"children":250},{"className":249},[],[251],{"type":43,"value":252},"pub",{"type":43,"value":246},{"type":37,"tag":51,"props":255,"children":257},{"className":256},[],[258],{"type":43,"value":259},"sub",{"type":43,"value":261},"、有界检查与收发验证",{"type":37,"tag":236,"props":263,"children":264},{},[265],{"type":37,"tag":60,"props":266,"children":269},{"href":267,"rel":268,"target":65},"https://github.com/emqx/MQTTX/blob/main/skills/mqttx-cli/references/workflows.md",[64,64],[270],{"type":43,"value":271},"基础工作流",{"type":37,"tag":214,"props":273,"children":274},{},[275,280],{"type":37,"tag":236,"props":276,"children":277},{},[278],{"type":43,"value":279},"传输协议、TLS/mTLS、WebSocket 头、凭据、SCRAM",{"type":37,"tag":236,"props":281,"children":282},{},[283],{"type":37,"tag":60,"props":284,"children":287},{"href":285,"rel":286,"target":65},"https://github.com/emqx/MQTTX/blob/main/skills/mqttx-cli/references/connections.md",[64,64],[288],{"type":43,"value":289},"连接与认证",{"type":37,"tag":214,"props":291,"children":292},{},[293,298],{"type":37,"tag":236,"props":294,"children":295},{},[296],{"type":43,"value":297},"MQTT 3/5、QoS、保留消息、会话、遗嘱、请求/响应、订阅属性",{"type":37,"tag":236,"props":299,"children":300},{},[301],{"type":37,"tag":60,"props":302,"children":305},{"href":303,"rel":304,"target":65},"https://github.com/emqx/MQTTX/blob/main/skills/mqttx-cli/references/mqtt-features.md",[64,64],[306],{"type":43,"value":307},"MQTT 功能",{"type":37,"tag":214,"props":309,"children":310},{},[311,316],{"type":37,"tag":236,"props":312,"children":313},{},[314],{"type":43,"value":315},"文本/二进制输入、交互式行模式、文件、编解码、Protobuf/Avro、随机负载",{"type":37,"tag":236,"props":317,"children":318},{},[319],{"type":37,"tag":60,"props":320,"children":323},{"href":321,"rel":322,"target":65},"https://github.com/emqx/MQTTX/blob/main/skills/mqttx-cli/references/payloads.md",[64,64],[324],{"type":43,"value":325},"负载与文件",{"type":37,"tag":214,"props":327,"children":328},{},[329,368],{"type":37,"tag":236,"props":330,"children":331},{},[332,338,339,345,346,352,353,359,360,366],{"type":37,"tag":51,"props":333,"children":335},{"className":334},[],[336],{"type":43,"value":337},"bench conn",{"type":43,"value":246},{"type":37,"tag":51,"props":340,"children":342},{"className":341},[],[343],{"type":43,"value":344},"bench pub",{"type":43,"value":246},{"type":37,"tag":51,"props":347,"children":349},{"className":348},[],[350],{"type":43,"value":351},"bench sub",{"type":43,"value":246},{"type":37,"tag":51,"props":354,"children":356},{"className":355},[],[357],{"type":43,"value":358},"simulate",{"type":43,"value":246},{"type":37,"tag":51,"props":361,"children":363},{"className":362},[],[364],{"type":43,"value":365},"ls --scenarios",{"type":43,"value":367},"、自定义生成器",{"type":37,"tag":236,"props":369,"children":370},{},[371],{"type":37,"tag":60,"props":372,"children":375},{"href":373,"rel":374,"target":65},"https://github.com/emqx/MQTTX/blob/main/skills/mqttx-cli/references/benchmarks-and-simulation.md",[64,64],[376],{"type":43,"value":377},"压测与数据模拟",{"type":37,"tag":214,"props":379,"children":380},{},[381,399],{"type":37,"tag":236,"props":382,"children":383},{},[384,390,391,397],{"type":37,"tag":51,"props":385,"children":387},{"className":386},[],[388],{"type":43,"value":389},"init",{"type":43,"value":246},{"type":37,"tag":51,"props":392,"children":394},{"className":393},[],[395],{"type":43,"value":396},"check",{"type":43,"value":398},"、帮助/版本、INI 默认配置、JSON/YAML 选项",{"type":37,"tag":236,"props":400,"children":401},{},[402],{"type":37,"tag":60,"props":403,"children":406},{"href":404,"rel":405,"target":65},"https://github.com/emqx/MQTTX/blob/main/skills/mqttx-cli/references/configuration.md",[64,64],[407],{"type":43,"value":408},"配置与工具命令",{"type":37,"tag":214,"props":410,"children":411},{},[412,417],{"type":37,"tag":236,"props":413,"children":414},{},[415],{"type":43,"value":416},"各命令精确的参数可用性与版本差异说明",{"type":37,"tag":236,"props":418,"children":419},{},[420],{"type":37,"tag":60,"props":421,"children":424},{"href":422,"rel":423,"target":65},"https://github.com/emqx/MQTTX/blob/main/skills/mqttx-cli/references/capabilities.md",[64,64],[425],{"type":43,"value":426},"能力清单",{"type":37,"tag":214,"props":428,"children":429},{},[430,435],{"type":37,"tag":236,"props":431,"children":432},{},[433],{"type":43,"value":434},"失败与诊断",{"type":37,"tag":236,"props":436,"children":437},{},[438],{"type":37,"tag":60,"props":439,"children":442},{"href":440,"rel":441,"target":65},"https://github.com/emqx/MQTTX/blob/main/skills/mqttx-cli/references/troubleshooting.md",[64,64],[443],{"type":43,"value":444},"故障排查",{"type":37,"tag":76,"props":446,"children":448},{"id":447},"试一试",[449],{"type":43,"value":447},{"type":37,"tag":45,"props":451,"children":452},{},[453],{"type":43,"value":454},"安装后，可以这样向 Agent 描述任务：",{"type":37,"tag":95,"props":456,"children":457},{},[458],{"type":37,"tag":45,"props":459,"children":460},{},[461],{"type":43,"value":462},"使用 mqttx-cli skill，验证本地 127.0.0.1:1883 broker 的消息收发。使用 mqttx-test/ 下的唯一 topic，在 15 秒内结束检查，并报告结果。",{"title":30,"searchDepth":464,"depth":464,"links":465},2,[466,467,468,469],{"id":78,"depth":464,"text":81},{"id":114,"depth":464,"text":117},{"id":187,"depth":464,"text":190},{"id":447,"depth":464,"text":447},"markdown","content:zh:cli:agent-skill.md","content","zh/cli/agent-skill.md","md",1789895727216]