Copied from https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md
YMMV: Tuya likes to change their website frequently and the below instructions may be slightly out of date. If something looks wrong, please open a new issue.
Note: both methods below require that your device works with the official Tuya Smart app. If your device only works with one specific app, it almost certainly won't work with TuyAPI.
All methods below require you to install the CLI tool before proceeding.
Install it by running npm i @tuyapi/cli -g
. If it returns an error, you may need to prefix the command with sudo
. (Tip: using sudo
to install global packages is not considered best practice. See this NPM article for some help.)