# Tuya Iot Platform

> Operate the Tuya Developer Platform via tuya-devplat-cli: create products, search products, manage DPs, and more. Wi-Fi + Bluetooth dual-mode only.

- Skill: `tuya/tuya-iot-platform` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add tuya/tuya-iot-platform`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tuya/tuya-iot-platform/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: tuya (https://skillmd.com/u/tuya)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tuya/tuya-iot-platform

---


# 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](ops/product.md) |
| Manage DPs (list / add / remove / validate) | [ops/manage-dp.md](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:

```bash
.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:

```bash
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:

```bash
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:

```bash
# 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_token` is one-time. Re-run `--dry-run` if the token expires or is lost.
- All flags between `--dry-run` and `--confirm` calls must be identical.
- `--raw-body` is mutually exclusive with named flags. Use it only for complex payloads.

### Discover commands

```bash
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:

```bash
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](ops/product.md).

> **Note:** `product solution-list` always returns empty — do not use it.
> Use `product custom-list` or `product communication-list` instead.

