Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

streamdeck-rs

Unofficial Stream Deck plugin SDK and CLI for Rust.

This is a private workspace; the crates are not published to crates.io.

Crate Role
streamdeck-plugin Plugin SDK (use streamdeck::...)
streamdeck-plugin-cli Binary streamdeck-plugin

The CLI binary is streamdeck-plugin, not streamdeck. Elgato’s Node CLI (@elgato/cli) already owns streamdeck and sd on PATH.

Quick start

Point the scaffold at this checkout if the CLI was built from a different tree, then run it from the workspace:

export STREAMDECK_PLUGIN_PATH=$PWD/crates/streamdeck-plugin
cargo run -p streamdeck-plugin-cli -- create

When you run the CLI from this workspace, the SDK path is resolved automatically. STREAMDECK_PLUGIN_PATH overrides that default.

The wizard scaffolds a native .sdPlugin (manifest, icons, increment-counter action, property inspector), builds the Rust binary, symlinks it into Stream Deck’s plugins folder, and restarts the plugin.

Library usage

use streamdeck::{KeyDownEvent, SingletonAction, StreamDeck};

struct SayHelloAction;

impl SingletonAction for SayHelloAction {
    const UUID: &'static str = "com.elgato.hello-world.say-hello";
    type Settings = serde_json::Value;

    async fn on_key_down(&self, ev: KeyDownEvent<Self::Settings>) {
        let _ = ev.action.set_title("Hello world").await;
    }
}

fn main() -> streamdeck::Result<()> {
    streamdeck::block_on(async {
        StreamDeck::new()?
            .register_action(SayHelloAction)?
            .connect()
            .await
    })
}

See crates/streamdeck-plugin/README.md for the protocol, namespaces, and .sdPlugin layout. See crates/streamdeck-plugin-cli/README.md for CLI commands. examples/increment-counter is an in-repo plugin used as a smoke test.

License

MIT

About

A just for fun Rust clone of the Stream Deck's Typescript SDK: https://github.com/elgatosf/streamdeck/tree/main/packages/plugin.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages