Reeve Docs

Docs / Development

Your first plugin in 15 minutes

This tutorial walks a plugin author from a fresh checkout to a plugin published as an OCI artifact that operators can install through the marketplace UI. The kit has three parts:

  1. A project template. dotnet new reeve-plugin --kind=Input generates the project, manifest, tests and IDE launch profiles with the right interfaces wired. The variant option is --kind because the dotnet new host reserves --type for project | item | solution.
  2. A reload loop. reeve-plugindev watch rebuilds on file change and drives the host's existing reload endpoint, so the development loop matches the production reload path.
  3. Pre-flight validation. The host runs it before it loads a candidate, and reeve-plugindev validate runs it locally. It uses MetadataLoadContext and never executes plugin code, so it catches a missing factory, a manifest mismatch or a version mismatch before the running instance is stopped.

Prerequisites

  • The .NET 11 SDK. The SDK packages and the dev tool restore from nuget.org, so no feed configuration is needed.

  • A checkout of the Reeve repository, from step 1 on (the template is installed from it), and for step 3 the database and Redis the backend needs, because the reload loop runs the backend from source. Start only those two from deploy/:

    cd deploy
    cp .env.example .env
    ./scripts/bootstrap-secrets.sh
    docker compose up -d timescaledb redis
    

    The backend run from source reads Password=reeve from its appsettings.json, while the script writes a random database password to deploy/secrets/postgres-password. Pass it to the backend with the environment variable Database__Password="$(cat deploy/secrets/postgres-password)" (see Database:Password). Do not start the full Compose stack: its backend would run beside the one you start from source.

  • A user with the integrations.manage permission, and a personal access token whose scope includes integrations.manage (see authentication).

Step 1 — Install the template (one-time)

dotnet new install ./templates/Reeve.PluginTemplate

Run it from a checkout of the Reeve repository. The template is in templates/Reeve.PluginTemplate/. Five variants are bundled: Input, Output, Trigger, Block, Notification. Input, Output and Notification generate an IPluginFactory with the matching primary interface; Trigger and Block generate an ITriggerPluginFactory or IWorkflowBlockFactory with its registration. Each comes with a manifest stub whose capabilities[] is already populated.

Step 2 — Scaffold the plugin

dotnet new reeve-plugin --kind=Input --name=MyWeatherInput --companyName=Acme
cd MyWeatherInput
dotnet build
dotnet test tests/

The project builds Reeve.Plugins.MyWeatherInput.dll. The smoke test under tests/ uses the PluginHarness (from Reeve.PluginAuthoring.TestKit) to load your DLL in-process, in a load context of its own, and assert that the factory's primary interface is reachable. The harness runs purely in memory, with no Docker and no network. The commands below run from the MyWeatherInput folder.

Step 3 — Hot-reload against a running backend

Install the dev tool, at the version of the SDK the plugin builds against (the Reeve.PluginAbstractions version in MyWeatherInput.csproj) or newer:

dotnet tool install -g Reeve.PluginDev

To pin it per repository instead, see the CLI reference.

watch rebuilds your project and asks the backend to reload the instance from the DLL the backend itself loaded, so the backend has to load your build output. Run it from source with its bundled plugin directory pointing there; a Reeve.Plugins.*.dll with no manifest beside it is loaded from that directory by naming convention (see the plugin reference):

cd <reeve-checkout>
Plugins__PluginsDirectory=<absolute-path>/MyWeatherInput/bin/Debug/net11.0 \
    dotnet run --project backend/src/Reeve.Api

The backend listens on http://localhost:5299. Add an instance of the plugin in the web app and copy its id from the address of its Diagnostics page (/app/admin/plugins/<instance-id>/diagnostics). Then, from the MyWeatherInput folder, run the watch loop:

reeve-plugindev watch \
    --project . \
    --backend http://localhost:5299 \
    --instance <instance-id> \
    --auth-header "Bearer <personal-access-token>"

On every .cs save the tool runs dotnet build and, on success, POSTs to /api/plugins/instances/{id}/reload — the same endpoint the admin UI's "Reload" button uses. The reload runs the pre-flight validator, drains any in-flight state (if your plugin implements IPluginDrainable), swaps the assembly, and replays state into the new instance.

If pre-flight rejects the candidate (factory missing, type-id mismatch, capability not declared, min-version unmet) the backend returns HTTP 422 with a structured PreflightValidationFailure { code, details[] } body and the existing instance keeps running. The tool prints the failure verbatim.

Step 4 — Validate locally without uploading

reeve-plugindev validate \
    --manifest ./reeve-plugin.json \
    --dll ./bin/Debug/net11.0/Reeve.Plugins.MyWeatherInput.dll

The validator runs the manifest through the parser the backend's install uses, then the same MetadataLoadContext-based pre-flight the host's reload runs, so "passes locally" implies that the install accepts the manifest and that the reload pre-flight passes. A source manifest's placeholder sha256 (REPLACED_BY_CI) is replaced by the hash of --dll before the parse. A Trigger or Block plugin, which has no IPluginFactory, passes when it exports its registration.

Step 5 — Publish to an OCI registry

The template ships a GitHub Actions workflow at .github/workflows/build-and-publish.yml. On a tag push (v0.1.0) it builds, runs the TestKit harness, packs the plugin with reeve-plugindev pack (which hashes and signs each framework build) and pushes the manifest and the layer to the repository's own registry with oras push, as ghcr.io/<owner>/<repo>:0.1.0. Set the REEVE_PLUGIN_SIGNING_KEY secret and the REEVE_PLUGIN_SIGNED_BY variable, or ALLOW_UNSIGNED=true for an unsigned release.

git tag v0.1.0
git push origin v0.1.0

The packed manifest declares builds, and a host accepts that only on the OCI channel. A GitHub release of the same files is skipped at sync. Operators add your plugin as an OCI repository, the registry host and repository without a tag (ghcr.io/<owner>/<repo>). ghcr.io is on the built-in host allowlist, so no Repositories:AllowedHosts entry is needed for it. A GitHub package starts private: make it public, or give the operator a token that can read it. The workflow downloads a pinned oras release and checks it against its published SHA-256 before using it.

  • TestKit reference — every public fake, helper, and the PluginHarness API.
  • Client-gated flows — gating an action flow on a client capability and asking the client for a secret value.
  • Flow end hook — stopping work a flow started when the host ends the flow: abort, timeout, expiry.
  • Dev CLI reference — reeve-plugindev subcommand reference.
  • JSON source generation — generated JSON metadata for stored values and session-plane payloads, so a missing type fails the build.
  • Plugin reference — plugin types, lifecycle, manifest schema, and the multi-step configuration flow for plugins that need OAuth, a pairing button or conditional fields.

Trust model

A native plugin is trusted in-process code. Its declared permissions are consent and an audit trail, not containment: an operator installing it is deciding to run your program on their server. A WebAssembly plugin runs in a real capability sandbox, which is the lane to prefer for community code.

The contribution kit helps you build and test a plugin; it does not sandbox one. PluginHarness simulates host services for offline unit testing, and the pre-flight validator catches honest mistakes — a missing required interface, a target-framework mismatch, capability declaration drift — without running plugin code.

There are no quality tiers and no certification programme; a manifest declaring one is rejected. The only trust signal is a signature the operator's own trusted key list verifies, computed server-side and impossible for an author to set. Sign your releases and request the narrowest permission set your plugin needs. See plugin trust and publishers.