create-plugin
Create Plugin
This skill is the embedded class: a Go package compiled into Sidecar with its own Bubble Tea UI. If what you want is a tool's data in Sidecar — a searchable tab, rows that open into documents, panes beside a terminal — you almost certainly want a protocol plugin instead: an executable in any language answering five JSON methods, which Sidecar renders itself and which ships as a config entry rather than a Sidecar release. Read docs/guides/active/creating-plugins.md and stop here. Come back only when the screen itself is the point — a board, a queue, a layout the collection-and-document vocabulary cannot express — because everything below costs a release, a keymap pass, and a permanent place in the repository.
Architecture Overview
- Bubble Tea model:
internal/app/model.goowns the active plugin index, dispatches key events, renders plugin views. - Registry:
internal/plugin/registry.gostores plugins, handles lifecycle with panic protection, keeps anunavailablemap whenInitfails (silent degradation). - Plugin contract:
internal/plugin/plugin.godefines the interface every plugin must satisfy. - Context:
internal/plugin/context.goprovidesWorkDir,ConfigDir,Adapters,EventBus,Logger,Epoch, andKeymap. - Keymap:
internal/keymapmaps keys to command IDs. Footer/help reads bindings by context usingPlugin.Commands()+Plugin.FocusContext().
Plugin Interface
Every plugin must implement all of these methods: