Plugin Development Guide#
This page is an overview. Detailed plugin development instructions are now part of each extension type’s development guide.
What is a Plugin?#
A plugin is a standalone executable that extends scafctl by communicating over gRPC using hashicorp/go-plugin . Plugins run in separate processes, providing crash isolation and independent distribution.
scafctl supports two types of plugins:
| Plugin Type | Artifact Kind | Interface | Guide |
|---|---|---|---|
| Provider Plugin | provider | plugin.ProviderPlugin (8 methods) | Provider Development Guide – Delivering as a Plugin |
| Auth Handler Plugin | auth-handler | plugin.AuthHandlerPlugin (9 methods) | Auth Handler Development Guide – Delivering as a Plugin |
Architecture#
flowchart LR A["scafctl<br/>- Discovers plugin<br/>- Configures providers<br/>- Calls extensions<br/>- Manages lifecycle"] <-- "gRPC" --> B["Your Plugin<br/>- Implements gRPC<br/>- Exposes handlers<br/>- Handles execution<br/>- Calls HostService"]
Each plugin binary exposes one extension type (provider OR auth handler). The handshake cookie determines which type the host expects.
Plugin Lifecycle#
- Discovery – scafctl finds the plugin binary (via catalog auto-fetch or directory scanning)
- Load – scafctl starts the plugin process and negotiates protocol version
- Configure – scafctl calls
ConfigureProvideronce per provider with host settings (quiet, color, binary name, HostService broker ID) - Execute – scafctl invokes providers as needed (unary or streaming)
- Callbacks – plugins can call back to the host for secrets and auth tokens via the
HostServicegRPC service - Shutdown – scafctl terminates the plugin process when done
Plugin Discovery#
scafctl resolves plugins through two mechanisms:
Catalog Auto-Fetch (Recommended) — Declare plugins in
bundle.pluginsand scafctl fetches, caches, and loads them automatically:spec: bundle: plugins: - name: my-plugin kind: provider # or "auth-handler" version: ">=1.0.0"Directory Scanning — For local development, place plugin binaries in the plugin cache:
mkdir -p "$(scafctl paths cache)/plugins"
cp my-plugin "$(scafctl paths cache)/plugins/" $pluginDir = "$(scafctl paths cache)/plugins"
New-Item -ItemType Directory -Force -Path $pluginDir
Copy-Item my-plugin $pluginDirPlugin CLI Commands#
# Pre-fetch plugins declared in a solution
scafctl plugins install -f my-solution.yaml
# List cached plugin binaries (remote download cache only)
scafctl plugins list
# Push to a remote registry
scafctl catalog push my-plugin@1.0.0 --catalog ghcr.io/myorg# Pre-fetch plugins declared in a solution
scafctl plugins install -f my-solution.yaml
# List cached plugin binaries (remote download cache only)
scafctl plugins list
# Push to a remote registry
scafctl catalog push my-plugin@1.0.0 --catalog ghcr.io/myorgNote:
plugins listshows only plugins fetched from the remote catalog cache. Local builds loaded via--plugin-dirare not listed. To see all available versions (including pre-release), use:scafctl catalog list --kind provider --pre-release --all-versions
Next Steps#
- Extension Concepts – Provider vs Auth Handler vs Plugin terminology
- Provider Development Guide – Build providers (builtin + plugin)
- Auth Handler Development Guide – Build auth handlers (builtin + plugin)
- Plugin Auto-Fetching Tutorial – Catalog-based distribution and signature verification