vagus-plugin 0.1.0

Rust SDK for building vagus plugins (vagus-<name> binaries): event emitter, env accessors, vault-safe note writes
Documentation

SDK for building vagus plugins — standalone vagus-<name> binaries that vagus core dispatches to (the git/kubectl/gh-extension pattern). See docs/plugin-contract.md.

Using this crate is optional: a plugin in any language can speak the protocol directly. In Rust it saves you from re-implementing the wire format, the env contract, and the vault-write guard.

Minimal plugin

use vagus_plugin::{Emitter, describe, is_describe};

fn main() -> std::io::Result<()> {
    let args: Vec<String> = std::env::args().skip(1).collect();
    if is_describe(&args) {
        describe("vagus-hello — example plugin");
        return Ok(());
    }
    let mut out = Emitter::from_env();
    out.progress(1, Some(1), "working");
    out.write_note("30-Resources/hello/note.md", "# hi\n\nfrom a plugin\n")?;
    out.result_ok(serde_json::json!({ "notes": 1 }));
    Ok(())
}