TuyaOpen is a cross-platform IoT SDK (C/C++) for smart hardware. It supports Tuya T-series MCUs, ESP32, Raspberry Pi, and Linux/Ubuntu. On Cursor Cloud, the LINUX target can be compiled and run natively on the host.
- Always respond in Simplified Chinese unless explicitly requested otherwise.
- Prefer concise progress updates while running commands.
- Do not use interactive workflows unless the task explicitly requires them.
Initialize the environment from repository root:
cd /workspace && . ./export.shWhat this does:
- Creates or reuses
.venv/ - Installs Python dependencies from
requirements.txt - Exports
OPEN_SDK_ROOT,OPEN_SDK_PYTHON, andOPEN_SDK_PIP - Makes
tos.pyavailable in the current shell
Standard flow:
tos.py checkto verify required tools and submodulescd examples/<category>/<project>tos.py build- Use binaries from
<project>/dist/(LINUX target produces native ELF)
tos.py config choiceandtos.py config menuare interactive TTY flows. Avoid them in non-interactive cloud runs.- Prefer editing
app_default.configdirectly for deterministic builds. - To avoid prompt blocks from platform commit checks, create:
mkdir -p .cache && touch .cache/.dont_prompt_update_platform- Single file or directory checks:
python tools/check_format.py --debug --files <file>python tools/check_format.py --debug --dir <dir>
- PR-style checks:
python tools/check_format.py --base <branch>
Expected packages (see Dockerfile):
build-essential, libsystemd-dev, locales, libc6-i386, libusb-1.0-0, libusb-1.0-0-dev, python3, python3-pip, python3-venv, clang-format
- For source changes, run the smallest relevant build or check for the touched area.
- For formatting-only updates, run
tools/check_format.pyagainst changed files. - For docs-only updates, verify file content, command correctness, and path validity.
- Build intermediates:
<project>/.build/ - Final outputs:
<project>/dist/ - Platform SDK cache:
platform/LINUX/