A Herdr plugin is a directory with a herdr-plugin.toml manifest plus any
executable command Herdr can launch by argv: Bash, Node, Python, Lua, a Rust
binary, anything available on the user's machine. Herdr owns installation,
manifest validation, keybindings, panes, events, and the socket; the plugin
owns its language, dependencies, files, and durable state. There is no plugin
SDK and no restricted command set — the entire herdr CLI is the plugin API.
Establish the version and authority first
- Run
herdr statusand record the client and server versions. The installed binary is the authority for command syntax and manifest validation; every contract in this skill was verified against Herdr 0.9.5 (protocol 22). herdr pluginexists on 0.9.5 even though top-levelherdr --helpdoes not list it. Print the group withherdr plugin; never run bareherdr, which launches or attaches the TUI.- Read sources and version boundaries before trusting any example. Unknown manifest fields are silently ignored, so a field typo or a documentation sketch can mislead without producing an error.
- Confirm
HERDR_ENV=1before any plugin or verification step controls live panes, agents, or workspaces.
Keep the three extension surfaces distinct
- Plugins (
herdr plugin ...): shareable workflow packages. This skill. - Integrations (
herdr integration install <agent>): status reporting for known coding agents. A different feature; do not recreate it here. - Agent and pane control (
herdr agent|pane|workspace ...): the runtime surface plugins call back into. Covered by theherdragent skill orherdr --skill; do not restate its full contract.
Choose the workflow
| Request | Read next | Required result |
|---|---|---|
| Author or fix a manifest | Manifest contract | Valid herdr-plugin.toml passing offline preflight and live link |
| Wire runtime behavior or Herdr callbacks | Runtime environment | Correct env/context handling with log evidence |
| Install, update, uninstall, or publish | Lifecycle and publishing | Correct registration path and marketplace listing |
| Add panes, popups, keybindings, or link handlers | Panes and UI | Declared entrypoints that open and close as designed |
Default execution sequence
- Start from the template. Copy assets/plugin-template.toml
and set
id,name,version, andmin_herdr_version(all required;min_herdr_versionis semver and must not exceed the installed Herdr version). - Preflight offline. Run
python3 <skill-dir>/scripts/check_plugin.py <plugin-dir>to catch id-charset, platform, command, event-name, duplicate-id, and popup-size issues before touching a live server. The script mirrors Herdr 0.9.5 validation rules and error codes. - Link for local development.
herdr plugin link <dir>registers the plugin without running[[build]]commands. Registration is global to the user and visible in every Herdr session; unlink withherdr plugin unlink <id>when finished. - Exercise the real surface.
herdr plugin action list --plugin <id>, thenherdr plugin action invoke <id>.<action-id>, thenherdr plugin log list --plugin <id>for captured stdout/stderr, exit codes, and status. A successful invoke acknowledges admission, not success: read the log before claiming the action works. - Verify the environment contract. Runtime commands execute with the
plugin directory as working directory and receive
HERDR_BIN_PATH,HERDR_PLUGIN_*, and context variables (runtime). Call back into Herdr throughHERDR_BIN_PATH, never a hardcoded socket path or a bareherdr. - Publish deliberately. GitHub repository with the
herdr-plugintopic, manifests at the root or in subdirectories of the default branch. Tell users to pin--refwhen reproducibility matters.
Non-negotiable boundaries
commandvalues are argv arrays. Herdr does not run them through a shell: no expansion, pipes, or redirects unless the command starts a shell itself.- Plugin code runs as the user with full CLI power. Review third-party
plugins before installing; never instruct users to bypass the install
preview with
--yesfor code they have not read.[[startup]]commands run automatically at server startup and are listed in the install preview. - GitHub-installed plugin roots are managed checkouts. Never store credentials
or durable state under the plugin root; use
HERDR_PLUGIN_CONFIG_DIRandHERDR_PLUGIN_STATE_DIR, which Herdr creates and never validates. - Plugins must stop detached background processes before their command or pane exits; processes surviving server exit are not protected from installation cleanup.
- Do not promise plugin-shipped keybindings, runtime action registration, a Herdr-managed storage API, or native non-terminal plugin UI — none exist in plugin v1. Bind keys to plugin actions through the user's config.toml.
- Never lower
min_herdr_versionjust to make a link succeed. A value above the installed version is a hardplugin_requires_newer_herdrerror, and that is the correct outcome for an unsupported host.
Deliverable
Return the plugin directory; a manifest that passes offline preflight and a
live herdr plugin link; verified action, event, or pane behavior with log
evidence; install or publish instructions; and explicit notes on anything
untested or version-dependent. If a behavior cannot be verified against the
installed binary, say so instead of generalizing from documentation.