I wanted the most basic and simpliest way to set up a Stream Deck plugin with the CLI and have it work with the debugger in VSCode. This repo is the result of following the steps below.
install CLI from: https://github.com/elgatosf/streamdeck
Run this command to use the CLI to create a new plugin:
streamdeck create
Then to link this to the Stream Deck app - run this command (NOTE: change com.chenzo.basic-simple-plugin
to whatever your plugin namespace is):
streamdeck link .\com.chenzo.basic-simple-plugin.sdPlugin\
after launching the Stream Deck app, you should see the plugin and the default Counter:
adjust the Nodejs Debug value in the manifest.json
file from enabled
to the following (pick the same port as the next step):
"Nodejs": {
"Version": "20",
"Debug": "--inspect=127.0.0.1:54545"
}
add the following attributes to the .vscode\launch.json
file:
"address": "127.0.0.1",
"restart": true,
"port": 54545
Make sure the port matches the one you picked in Step 4.
in a terminal run npm run watch
then in VSCode, press f5 or click the debug icon and select Attach to Plugin
from the dropdown.
and then when the attach dialog comes up, find the process with same port defined in Step 4 and click on it.
at this point you can hit the counter a couple of times in the Stream Deck and look in the Debug Console and see the console log output from line 28 in src\actions\increment-counter.ts
change the console.log and save the file and the plugin will automatically reload in the Stream Deck app and also have the debugger re-attach and show the new message in the Debug Console.