# Tuya CLI
> A CLI for controlling Tuya smart devices

## 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

## When to Use
- 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

## When NOT to Use
- 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)

## 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

## Installation
- **npm**: `npm install -g @tuyapi/cli`

---
Source: https://littlescripts.sh/tools/tuya-cli
