Settings

Theme

Show HN: NPM Scripts Deck – Run NPM scripts from Stream Deck with dynamic button

github.com

2 points by ugaya40 8 hours ago · 0 comments · 1 min read

Reader

I built a VSCode extension that auto-generates Stream Deck buttons from your package.json. Press to run, press again to cancel. Supports monorepos and multiple VSCode windows — buttons always follow the active file's context.

To make this work, I also built Stream Deck Integration, a framework that handles VSCode–Stream Deck communication. A notable aspect is its multi-instance coordination. VSCode has no way for multiple windows to talk to each other, so the framework uses a Leader/Follower pattern over WebSocket. The first instance becomes Leader, later ones connect as Followers. If the Leader closes, a Follower promotes itself with a randomized delay to avoid port conflicts.

The framework is extensible — if you want to build a provider for Docker, Git, or anything else, you only implement single-instance logic. Multi-instance coordination is handled by Stream Deck Integration.

No physical Stream Deck? You can try it with Elgato's free Virtual Stream Deck.

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection