Reeve Docs

Docs / Development

reeve-plugindev: CLI reference

reeve-plugindev is a .NET tool for plugin authors. It rebuilds and reloads a plugin while you work, runs the host's pre-flight checks locally, validates and renders a deployment manifest, replays adapter frames against an observer, and packs a plugin for release. It is published on nuget.org as the Reeve.PluginDev dotnet tool, at the same version as the SDK packages.

The tool is a thin wrapper around dotnet build, dotnet test and an HTTP client that drives the host's existing reload endpoint. There is no separate hot-reload path: whatever watch triggers also happens when an operator clicks "Reload" in the admin UI, so the development loop matches production.

Install

dotnet tool install -g Reeve.PluginDev
reeve-plugindev --help

To pin the tool per repository, use a tool manifest. dotnet tool restore then installs it on any machine:

dotnet new tool-manifest
dotnet tool install Reeve.PluginDev --version <sdk-version>
dotnet tool run reeve-plugindev --help

Use the tool at the version of the SDK the plugin builds against, or newer. In CI, install it into a local directory:

dotnet tool install Reeve.PluginDev --version <sdk-version> --tool-path "$PWD/.reeve-tools"
export PATH="$PWD/.reeve-tools:$PATH"

The tool runs on the .NET 11 runtime and the ASP.NET Core 11 runtime, because it loads the host's own plugin loader, which references Microsoft.AspNetCore.App. The mcr.microsoft.com/dotnet/sdk:11.0 image has both, and a runtime-only dotnet/runtime image does not. The tool does not roll forward to a newer major version. What pack strips and checks is judged against the shared framework of the runtime the host runs, and a tool executing on another major would judge a different one.

Subcommands

watch: rebuild on change, drive reload

reeve-plugindev watch \
    --project <path-to-plugin-csproj-folder> \
    --backend http://localhost:5299 \
    --instance <instance-guid> \
    [--debounce-ms 250] \
    [--auth-header "Bearer <token>"]
  • A debounced file watcher observes *.cs and *.csproj, excluding bin/ and obj/.
  • On each batch, watch runs dotnet build <project> and waits for it.
  • After a successful build it POSTs to <backend>/api/plugins/instances/<instance>/reload, the same endpoint the admin interface calls.
  • It prints the response body, so a 422 pre-flight rejection (preflight_factory_missing, preflight_type_mismatch, preflight_capability_mismatch, preflight_min_backend_version_fail) is visible in the terminal with its structured details.

validate: run pre-flight on a manifest + DLL pair locally

reeve-plugindev validate \
    --manifest <path-to-reeve-plugin.json> \
    --dll <path-to-plugin.dll> \
    [--host-version <version>]
  • --host-version defaults to the Reeve version the tool was built with, so a manifest whose minBackendVersion is that version or lower passes the version check.
  • It runs the manifest through the parser the backend's install uses (invalid_manifest and the other install reasons), with a source manifest's placeholder sha256 (REPLACED_BY_CI) replaced by the hash of --dll. It then runs the same PluginPreflightValidator the host uses against the DLL, through MetadataLoadContext, so no plugin code executes.
  • An assembly with no IPluginFactory passes when it exports a workflow block, trigger or alert subscriber registration, as a Block or Trigger plugin does. Its manifest's backend floor is still checked.
  • It refuses a pluginTypeId that contains : or is . or .. (preflight_reserved_storage_namespace), as the host does at install.
  • It prints {"status":"ok"} on success (exit 0) or the structured PreflightValidationFailure JSON on rejection (exit 3). It contacts no backend and uploads nothing.

test: run the plugin's test project

reeve-plugindev test --project <path-to-plugin-csproj-folder>

A wrapper around dotnet test <project>/tests. Authors normally run dotnet test directly.

deploy validate and deploy render: check a sidecar deployment

reeve-plugindev deploy validate <manifest> [--schema <path>]
reeve-plugindev deploy render <manifest> --provider kubernetes|compose|manual [--out <dir>] \
    [--gateway-url <url>] [--reveal-token] [--params <json>] [--plugin-type-id <id>]

validate checks the manifest's deployment section offline against the published deployment.schema.json (embedded in the tool, --schema overrides it) and the backend's strict parser. It prints PASS or FAIL with pointer paths, and exits 0 when valid and 1 when not. render produces the deployment artifacts (Kubernetes objects, a Compose service or Helm values) from the same desired-spec and renderer registry the backend's Manual provider uses. A revealed token is the placeholder rwt_PLACEHOLDER, never a real credential. Extra trusted root certificates come from the Tls__TrustedCaCertificates environment variable as a single-line PEM with line breaks written as \n.

observe replay: prove an adapter observer

Replays a frame file into two copies of your plugin over a real Redis and compares what the follower builds with what the owner builds. See proving your observer.

pack: publish one build per target framework

reeve-plugindev pack \
    --project <path-to-plugin.csproj> \
    [--manifest <path>] [--out reeve-plugin-pack] \
    (--key <pem> [--signed-by <label>] | --unsigned) [--version <semver>]
  • It publishes each evaluated target framework into <out>/<tfm>/, strips the host-shared assemblies and what is reachable only through them, and writes <out>/reeve-plugin.json (with builds) and <out>/layer.tar.
  • --version defaults to the GITHUB_REF_NAME environment variable when GITHUB_REF_TYPE is tag (a cast/v1.2.3 or v1.2.3 tag is read as 1.2.3), then to the manifest's version. Anything that is not SemVer is refused.
  • Exactly one of --key and --unsigned is required. --unsigned writes builds without a signature and prints a warning on stderr. A host that requires signatures refuses such a release. Any other host records it as unsigned and, on an update from a verified release, raises the critical signature_dropped anomaly.
  • --key is an Ed25519 private key in PEM, the file openssl genpkey -algorithm Ed25519 writes. Each build's signature covers the lowercase-hex SHA-256 of its entry assembly.
  • --signed-by sets the manifest's signedBy label, replacing one in the committed manifest. Without it a committed signedBy is kept, and with neither, --key is refused. The host compares the label with the one on the trusted key and flags a release whose label differs from the previous one, so a repository that signs with the reeve key passes --signed-by reeve on every release.
  • After publishing, pack loads each build's entry assembly, as the backend's install gate does, and applies the install check to the factory for the manifest's pluginTypeId. Each token in the manifest's hosts or the factory's RequestedHosts must name exactly one Text or Password field of its ConfigurationSchema. Loading runs the build's code: its IPluginRegistration, the factory's properties and any static constructors they reach. A build that references a newer Reeve.PluginAbstractions than the tool's own is refused before it is loaded, so update reeve-plugindev. A refusal names the fault code (UndeclaredField, AmbiguousField, UnsupportedFieldType, ConflictingModes for one field read as both a URL and a host, NoFactory, RegistrationFailed, Uninspectable) and writes nothing to --out. A malformed token or an unknown mode is refused as invalid_manifest by the manifest parser.
  • The host's rules for tokens are in config host tokens.
  • --out is created if absent and replaced only when it holds a previous pack output. Any other content makes pack refuse before it publishes. Every refusal exits with code 1. The authoring guide lists what it strips and refuses.

Signing is not optional

pack refuses to run without --key unless --unsigned is passed, which it announces on stderr. It refuses --key without a signer label (--signed-by, or a signedBy already in the manifest), and it refuses --unsigned together with either. A release job therefore has to decide, and the recipe below decides in the open: it fetches the key first, fails a release in your own repository when the key is missing, and checks the manifest it got back. Without those steps a release could go out unsigned, and every host that has verified the previous release raises signature_dropped and asks for confirmation.

A release job

If the plugin has a sidecar, the image digest goes into a copy of the manifest before pack, because pack refuses a manifest the backend would refuse, and a sha256:REPLACED_BY_CI digest is one.

This is the shape of the GitHub Actions step in the plugin template. The repository secret REEVE_PLUGIN_SIGNING_KEY holds the Ed25519 private key in PEM form, and the repository variable REEVE_PLUGIN_SIGNED_BY holds the label of your trusted signing key. A third-party publisher sets its own label. The reeve label belongs to the official key.

# 0. The signing key, before anything is built. A fork has no access to the secret.
if [ -n "${SIGNING_KEY:-}" ]; then
  : "${SIGNED_BY:?set the REEVE_PLUGIN_SIGNED_BY variable to the label of your trusted signing key}"
  KEY_FILE="$(mktemp)"; printf '%s\n' "$SIGNING_KEY" > "$KEY_FILE"
elif [ "${ALLOW_UNSIGNED:-}" != "true" ]; then
  echo "ERROR: no signing key for release $GITHUB_REF_NAME"; exit 1
fi

VERSION="${GITHUB_REF_NAME##*/}"; VERSION="${VERSION#v}"

# 1. Stamp what only the pipeline knows (a plugin with a sidecar; others skip this).
printf '%s' "$ADAPTER_IMAGE_DIGEST" | grep -Eq '^sha256:[0-9a-f]{64}$' && ! printf '%s' "$ADAPTER_IMAGE_DIGEST" | grep -Eq '^sha256:0+$' \
  || { echo "ERROR: '$ADAPTER_IMAGE_DIGEST' is not a real image digest"; exit 1; }
jq --arg d "$ADAPTER_IMAGE_DIGEST" '.deployment.workloads[0].image.digest=$d' \
   reeve-plugin.json > reeve-plugin.stamped.json

# 2. Pack and sign.
if [ -n "${KEY_FILE:-}" ]; then
  set -- --key "$KEY_FILE" --signed-by "$SIGNED_BY"
else
  set -- --unsigned
fi
reeve-plugindev pack --project src/MyPlugin/MyPlugin.csproj --manifest reeve-plugin.stamped.json \
    --out pack-out --version "$VERSION" "$@"

# 3. Assert what the host will look for, on the manifest pack wrote.
if [ -n "${KEY_FILE:-}" ]; then
  jq -e --arg by "$SIGNED_BY" '(.builds | length > 0 and all(has("signature"))) and .signedBy == $by' \
    pack-out/reeve-plugin.json > /dev/null || { echo "ERROR: the packed manifest is not signed as $SIGNED_BY"; exit 1; }
fi

# 4. Publish. pack names the layer layer.tar.
cp pack-out/reeve-plugin.json reeve-plugin.json
cp pack-out/layer.tar plugin-layer.tar
oras push "$IMAGE:$VERSION" \
    --config reeve-plugin.json:application/vnd.reeve.plugin.config.v1+json \
    plugin-layer.tar:application/vnd.reeve.plugin.layer.v1.tar

pack signs inside, so nothing edits the manifest after it. The size check against the 50 MB extraction cap is also inside pack. Plugins without a sidecar skip step 1 and pass --manifest reeve-plugin.json.

tools/sign-plugin.sh <plugin.dll> <private-key.pem> in the repository prints the base64 Ed25519 signature of a DLL's lowercase-hex SHA-256, which is the value of a flat manifest's signature. pack does the same for every build.

Exit codes

Code Meaning
0 Success
1 Unexpected error (logged with stack trace), including a missing required flag; a pack refusal; or deploy validate found the manifest invalid
2 No subcommand or an unknown one, a project, manifest or DLL path that does not exist, a missing deploy argument, or an observe replay run that could not certify anything
3 Pre-flight validation rejected the candidate (validate), or an observe replay verdict of failure

Auth header for protected backends

When the target backend requires authentication, which is the default, pass --auth-header "Bearer <token>". The token must be a session token or a personal access token whose scope includes integrations.manage (see API authentication).

Trust model

The tool is an HTTP client of the host's existing reload endpoint. It never calls into the host's plugin instance manager directly, never bypasses authentication and never bypasses pre-flight. A plugin reloaded by reeve-plugindev watch goes through the same pipeline as one reloaded by an admin clicking the button: pre-flight through MetadataLoadContext, drain capture (if the running instance implements IPluginDrainable), stop, unload of the load context, reload, and restore (if drained).