-
First, acquire API credentials by following this guide. The process should just take a few minutes.
-
Next, install the CLI tool by running
npm i @tuyapi/cli -g
. If it returns an error, you may need to prefix the command withsudo
. (Tip: usingsudo
to install global packages is not considered best practice. See this NPM article for some help.) -
Run
tuya-cli link-wizard
. It will walk you through the process of linking your device(s). When it's finished, copy the resulting device(s)id
andlocalKey
.