Tuya IoT Platform
Operate the Tuya Developer Platform via tuya-devplat-cli.
Communication type: This skill only targets Wi-Fi + Bluetooth (
wf_ble_*) dual-mode solutions.
Operations
| Operation | File |
|---|---|
| Search / list / create product | ops/product.md |
| Manage DPs (list / add / remove / validate) | ops/manage-dp.md |
Common conventions
CLI binary
The CLI wrapper is generated by TuyaOpen IDE at .tuyaopen/ide/bin/tuya-devplat-cli
(.tuyaopen/ide/bin/tuya-devplat-cli.cmd on Windows). Use this path directly when
tuya-devplat-cli is not in PATH:
.tuyaopen/ide/bin/tuya-devplat-cli --help
The Python helper scripts (scripts/product.py, scripts/manage_dp.py) auto-detect
this binary by searching upward from the current working directory. You can also override
the path via the TUYA_DEVPLAT_CLI environment variable.
Auth
Always verify auth before any operation:
tuya-devplat-cli auth status # must show "authenticated"
If not authenticated, ask the developer to sign in via TuyaOpen IDE → Developer Platform sidebar.
Never run auth login directly — it requires interactive browser input and will hang.
Output format
Always pass --format json for machine-readable output.
Use --fields a,b,c and --max-items N to limit large responses:
tuya-devplat-cli product list --format json --fields id,name,categoryName --max-items 20
Write operations: dry-run → confirm
All mutating commands require a two-phase flow:
# Phase 1: preview — returns confirm_token, does NOT send the request
tuya-devplat-cli <group> <command> [flags] --dry-run --format json
# Phase 2: execute — re-run with identical flags, replace --dry-run with --confirm
tuya-devplat-cli <group> <command> [flags] --confirm <token> --format json
Rules:
confirm_tokenis one-time. Re-run--dry-runif the token expires or is lost.- All flags between
--dry-runand--confirmcalls must be identical. --raw-bodyis mutually exclusive with named flags. Use it only for complex payloads.
Discover commands
tuya-devplat-cli schema list --format table # all groups
tuya-devplat-cli schema get --group <g> --command <c> --format json # one command detail
Fallback: use --help to explore
When a command fails or parameters are unclear, always fall back to --help before giving up:
tuya-devplat-cli --help # top-level groups
tuya-devplat-cli <group> --help # commands in a group
tuya-devplat-cli <group> <command> --help # flags for a specific command
--help output shows required vs optional flags, types, defaults, and usage examples.
Use it whenever an error says "unknown flag", "missing parameter", or the schema alone is insufficient.
Reference data
Category codes (Wi-Fi + BT)
| Chinese name | category code | frontend category | solution ID | DP note |
|---|---|---|---|---|
| 其他 | qt |
wf_ble_qt |
10019526 |
Default. No standard DP catalog — full freedom, DP IDs start from 1. |
| 插座 | cz |
wf_ble_cz |
134001 |
Standard DPs 1–100; custom DPs start at 101. |
| 灯具 | dj |
wf_ble_dj |
— (look up via Case A: custom-list --category-code dj → solutionModuleVOS[].code) |
Standard DPs 1–100; custom DPs start at 101. |
For categories not listed, follow the lookup steps in ops/product.md.
Note:
product solution-listalways returns empty — do not use it. Useproduct custom-listorproduct communication-listinstead.