mqttx-cli
Skill này làm gì
Skill này chạy lệnh mqttx để gửi và nhận tin nhắn MQTT, kiểm tra kết nối và mô phỏng dữ liệu mẫu. Skill dành cho lập trình viên và người kiểm thử làm việc với nhắn tin MQTT.
Khi nào nên dùng
- ✓Khi bạn muốn kiểm tra việc xuất bản hoặc đăng ký các chủ đề MQTT.
- ✓Khi bạn muốn kiểm tra kết nối broker hoạt động với TLS hoặc đăng nhập.
- ✓Khi bạn muốn chạy một benchmark MQTT nhanh hoặc mô phỏng các tin nhắn mẫu.
Liên kết skill
https://github.com/emqx/MQTTX/blob/main/skills/mqttx-cli/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Đăng ký chủ đề sensors/temp trên broker thử nghiệm của tôi và hiển thị các tin nhắn khi chúng đến.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kiểm tra công cụ mqttx và phần trợ giúp của nó, đặt thông tin broker và chạy lệnh với giới hạn thời gian đã định. Agent báo cáo các tin nhắn hoặc lỗi nó thấy.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
MQTTX CLI
Prepare
- Locate
mqttx, readmqttx --version, then inspectmqttx <command> --helpfor the task. Treat installed help as authoritative; release channels can differ. If missing or a required feature is unavailable, follow the repository's rootINSTALL.md, or its standalone installation guide when this skill has been copied elsewhere. Do not update a working CLI on every invocation. - Establish the broker hostname, port, transport (
mqtt,mqtts,ws,wss), MQTT version, credentials, topic and intended operation from the user's context. Ask only for missing information that affects execution. Use the requested broker; do not substitute a public broker after a failure. - Account for
~/.mqttx-cli/config, which can supply default host, port, protocol and credentials. Do not print its secrets or overwrite it for a one-off task. Explicit CLI arguments override defaults;--load-optionsloads command-specific JSON/YAML options, with explicitly supplied CLI arguments taking precedence. See configuration and utility commands for initialization, saving and loading. - Set a finite observation deadline for connection/subscription tasks and retain a handle to each process started. Use the agent's process controller or an available OS timeout tool; a tool returning a session handle is not necessarily a deadline. Terminate and wait for owned processes at completion or timeout.
The CLI command registration in this repository (1.13.0) does not offer general --timeout, --max-messages, --json or --output jsonl flags. Do not invent them. Recheck help for other versions. --reconnect-period 0 disables reconnection; it is not an overall deadline. conn stays connected after success and sub keeps listening until stopped.
Choose a workflow
This skill covers every command registered in the repository's CLI 1.13.0, including command-specific limitations. Read only the references relevant to the task. Coverage describes how to operate available features; it does not make unsupported combinations work or guarantee every broker implements them.
| Task | Read |
|---|---|
conn, pub, sub, bounded checks and round trips |
Basic workflows |
| Transport, TLS/mTLS, WebSocket headers, credentials, SCRAM | Connections and authentication |
| MQTT 3/5, QoS, retained messages, sessions, wills, request/response, subscription properties | MQTT features |
| Text/binary input, interactive line mode, files, codecs, Protobuf/Avro, random payloads | Payloads and files |
bench conn, bench pub, bench sub, simulate, ls --scenarios, custom generators |
Benchmarks and simulation |
init, check, help/version, INI defaults, JSON/YAML options |
Configuration and utilities |
| Exact flag availability by command and version-specific caveats | Capability map |
| Failures and diagnosis | Troubleshooting |
Read workflows for executable examples of a bounded connection check, one-message publish, bounded subscription, and end-to-end verification.
- Connection check: use
conn, capture diagnostics, and stop after observingConnectedor reaching the deadline. Report MQTT connection success separately from publish/subscribe permissions. - Publish: use
pubfor a single message. Prefer--file-reador--stdinfor complex payloads. Honor the requested QoS; use QoS 1 for a diagnostic round trip when unspecified. A publish success is not evidence that a subscriber or application processed the message. - Observe messages: use
subwith the requested topic filters and a bounded observation window. Preserve topic, QoS and relevant payload evidence. Quote wildcard filters in the shell. Never infer that a topic does not exist from an empty observation window. - Verify delivery: start the subscriber first, wait for the expected topic's
Subscribed to ...confirmation, then publish a unique marker and match the exact topic and marker. Do not use a fixed sleep as proof of subscription readiness. Use distinct client IDs and stop both processes on every completion path. - Troubleshoot: consult [troubleshooting](references/troub
Câu hỏi thường gặp
Nó có quản lý chính broker MQTT không?
Không. Skill bao phủ việc vận hành MQTT qua lệnh mqttx, không phải quản trị broker.
Nó có hoạt động với ứng dụng MQTTX trên máy tính không?
Không. Skill nói rằng nó không vận hành ứng dụng trên máy tính.
Cài đặt kết nối đã lưu được giữ ở đâu?
Trong một tệp cấu hình nằm trong thư mục mqttx-cli ở thư mục home của bạn. Agent không in hay ghi đè tệp này cho một tác vụ dùng một lần.
Chi tiết
Mô tả gốc của tác giả
Use MQTTX CLI for MQTT connections, publishing and subscriptions, MQTT 5 features, TLS and SCRAM authentication, payload codecs and schemas, benchmarks, built-in or custom data simulation, configuration, installation and troubleshooting. Use when operating or testing MQTT through the mqttx command. Does not operate MQTTX Desktop or administer a broker.
repo: emqx/MQTTX
Độ phổ biến
- Sao GitHub
- 5.1k
- Vị trí xếp hạng
- #15048
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.