Plugins¶
Pegg supports plugins that extend its functionality. Plugins are standalone binaries that run in separate processes and communicate with Pegg via RPC.
Configuration¶
Add plugin configuration to ~/.peggco/pegg.json:
Options¶
| Key | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
Enable or disable the plugin system |
exclude |
string[] | [] |
List of plugin names to skip during loading |
Plugin directory¶
Plugins are loaded from ~/.pegg/plugins/. Pegg scans this directory at startup
for executable files and attempts to load each one as a plugin.
Managing plugins¶
Lifecycle¶
- At startup, after all core modules are initialized, Pegg scans the plugin directory for executables.
- Each executable is launched as a separate process via HashiCorp go-plugin.
- The plugin's
Bootmethod is called with aDepsstruct containing the application configuration. - If a plugin fails to load, a warning is logged and Pegg continues normally.
- On shutdown, all plugin processes are terminated.
Troubleshooting¶
pegg plugin list # Check if plugins are detected
pegg logs --search plugin # Check plugin-related logs
Common issues:
- Plugin not appearing — The executable must be in
~/.pegg/plugins/and have execute permission. - Plugin fails to load — Check logs for the specific error. Common causes include missing dependencies or incompatible versions.
- Plugin excluded — Check the
excludelist in your config.