Packaging & Loading
Once your manifest and your Rust library are ready, getting them into Griffon is the easy part.
1. Build the library
cargo build --release
This produces your compiled .so (e.g. target/release/libmy_plugin.so).
2. Double-check the manifest and library agree
Before packaging, make sure:
- The
uuidin[plugin](your.toml) matches theUUIDyour library returns frominit(). - Every
fn = "..."used in an[[interactions.steps]]block in the manifest is also handled in your library'shandle_message(), and is listed in thefunctionentry returned byinit(). - Every
tabreferenced by a[[ui.sections]]block exists in[plugin].tabs.
Mismatches here won't necessarily fail to load — they tend to fail silently at the point a user clicks the affected button, so it's worth double-checking manually until we have tooling to validate this automatically.
3. Zip the two files together
zip my_plugin.zip libmy_plugin.so my_plugin.toml
The archive should contain just these two files — no folders, no extra assets.
4. Load it into Griffon
From the Griffon settings menu, load the .zip archive. Griffon will:
- Extract the manifest and build the UI described in
[ui], using the tabs and defaults from[plugin]/[store]. - Dynamically load the
.soand callinit()to fetch metadata and register available functions. - Wire up the
[[interactions]]so that UI actions call into your library throughhandle_message().
Checklist
-
Cargo.tomlhascrate-type = ["cdylib"] -
init()returns real metadata, including aUUIDmatching the manifest'suuid -
init()'sfunctionlist matches exactly whathandle_message()handles -
handle_message()returns valid JSON (or anERR ...string) for every supported function - Manifest's
tabscover everytabused by a section - Every
fn = "..."in an interaction step matches a function your library implements -
cargo build --releasesucceeds and produces a.so -
.soand.tomlzipped together with no extra files - Plugin loads in Griffon, all tabs render, and at least one function call round-trips correctly
That's the full loop — manifest to UI, UI actions to interactions, interactions to your Rust functions, and results back into the store to refresh the UI. As mentioned in the overview, tooling to reduce or generate the manifest automatically is planned but not available yet, so this manual workflow is the current path for building a plugin.