← Back to tools

Tuya CLI

A CLI for controlling Tuya smart devices

smart-home linuxmacoswindows JavaScript MIT

Description

Tuya CLI is a command-line tool for interacting with Tuya-based smart home devices. It supports linking new devices, getting and setting device properties, listing locally saved devices, mocking devices for testing, and a wizard for discovering devices via official Tuya applications. Part of the broader TuyaAPI ecosystem for local and cloud control of Tuya IoT devices.

When to use this tool

Good fit when
  • You want to control Tuya smart devices from the terminal
  • You need to automate Tuya device operations
  • You want to discover and pair Tuya devices without the app
  • You need to test Tuya device integrations locally
Avoid when
  • You don't have Tuya-compatible smart devices
  • You prefer a GUI-based smart home app
  • You need a fully maintained and actively updated solution (project is inactive)

Install

npmnpm install -g @tuyapi/cli

AI Summary

Command-line interface for controlling Tuya-based smart home devices locally and via the cloud, with support for device pairing, property management, and testing.

Capabilities

  • + Link and pair new Tuya devices
  • + Get and set device properties
  • + List locally saved devices
  • + Mock Tuya devices for local testing
  • + Wizard for discovering devices via official Tuya apps
  • + Cloud-based Tuya service access

Use When

  • You want to control Tuya smart devices from the terminal
  • You need to automate Tuya device operations
  • You want to discover and pair Tuya devices without the app
  • You need to test Tuya device integrations locally

Avoid When

  • x You don't have Tuya-compatible smart devices
  • x You prefer a GUI-based smart home app
  • x You need a fully maintained and actively updated solution (project is inactive)

Usage Patterns

Run device wizard

tuya-cli wizard

Launches an interactive wizard to discover devices from your Tuya account

Get a device property

tuya-cli get --id <device-id> --key <device-key>

Retrieves the current state of a Tuya device

Set a device property

tuya-cli set --id <device-id> --key <device-key> --set '{"dps":1,"set":true}'

Sets a property on a Tuya device

View AGENTS.md for Tuya CLI