plugin marketplace
Corral plugins are standalone corral-<name> executables. The marketplace is
discovery and verified delivery; it does not load third-party code into the
main Corral process.
Authoring contractβ
- Name the executable
corral-<name>, where the name matches^[a-z][a-z0-9-]{0,62}$. - Accept normal CLI arguments directly. Corral connects stdin/stdout/stderr and returns the plugin process's exit status. Human output belongs on stdout; diagnostics belong on stderr.
- Read
CORRAL_PLUGINwhen behavior depends on the dispatched name. Honor the sameCORRAL_KUBE_CONTEXT,CORRAL_INCUS_REMOTE, andCORRAL_LIBVIRT_URIone-shot context variables as core commands. Never switch kubectl, Incus, or libvirt global state. - Implement
--corral-plugin-metadata. It must print one JSON object using APIcorral.plugin/v1and exit successfully without doing other work. Go plugins can callsdk.HandleMetadatabefore constructing their command. - Treat capabilities and permissions as declarations, not authorization. Corral asks for install consent; the plugin must still use least-privilege credentials and rely on Kubernetes, filesystem, and network enforcement.
- Declare
supportedBackendsusingqemu,kubevirt,incus,libvirt, orall. Reject a selected backend before mutation when it is not supported; do not silently fall back to another context.
Minimal Go entry point:
package main
import (
"fmt"
"os"
"github.com/tuna-os/corral/pkg/plugin/sdk"
)
func main() {
if sdk.HandleMetadata(sdk.Metadata{
Name: "hello", Version: "1.0.0",
Capabilities: []string{"cli-command"},
Permissions: []string{"read Corral configuration"},
SupportedBackends: []string{"all"},
}) { return }
fmt.Fprintln(os.Stdout, "hello from Corral")
}
Test the binary directly, test the metadata handshake, then test dispatch with
CORRAL_PLUGIN_DIR=/path/to/bin corral hello. Plugins should not import
cmd; reusable backend behavior belongs in a pkg/ package.
External marketplaceβ
- Build immutable binaries for each advertised platform.
- Publish them at HTTPS URLs that will never be replaced.
- Create an index conforming to
marketplace/schema-v2.json. Every artifact needs its SHA-256 digest. Publishers may additionally sign the lowercase digest with Ed25519 and publish the base64 public key. - Validate it with
corral marketplace validate index.json. - Host the index over HTTPS and test it with
corral marketplace add <source> <url>.
Duplicate plugin names must be selected as source/name. Installation shows
the publisher, requested permissions, and requires explicit permission
consent. Corral verifies compatibility, digest, and any supplied signature
before atomically replacing an installed plugin; failed state writes roll the
binary back.
Recommended CIβ
Build from a version tag, run the plugin's tests, generate checksums, validate
the index, and publish both artifacts and index in one immutable release. The
repository's scripts/generate-marketplace.sh and publish-plugins workflow
are a working reference.
First-party pluginsβ
The maintained catalog and its maturity are documented in first-party-plugins.md. First-party means published by tuna-os through the curated marketplace; it does not grant the plugin more runtime privilege than an external plugin.