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) matchesmeta.uuidin yourexport_plugin!call. - Every
fn = "..."used in an[[interactions.steps]]block in the manifest is registered on yourPluginRouterwith.method(...). - 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"] -
export_plugin!has real metadata, with auuidmatching the manifest'suuid - Every manifest
fn = "..."has a matching.method(...)on the router - Each function has a unit test using
PluginRouter::call_json - 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.