Packaging and Publishing Plugins
When your plugin is ready to share, follow this checklist and publish it to the CodeBolt registry.
Pre-publish Checklist
-
package.jsonincludes a validcodebolt.pluginblock -
mainfield points to the compiled entry file (dist/index.js) - Plugin builds successfully (
npm run build) - Plugin starts cleanly and handles
onStart()without crashing -
onStop()performs proper cleanup (unregister providers, close connections) - Required credentials or environment setup is documented
- If using UI panels, the HTML file exists at the declared
ui.path
By plugin type
LLM Provider plugins:
- Document
providerIdand supported models - Document config fields users need to fill in (API key, base URL, etc.)
- Handle both
onCompletionRequestandonStreamRequest
Chat gateway plugins ("type": "channel"):
- Document the external platform setup (bot tokens, webhook URLs)
- Use
kvStorefor configuration persistence (not filesystem) - Provide a UI panel for connection configuration
- Document supported thread strategies
Execution plugins:
- Document what types of requests are intercepted
- Document the response shape returned via
sendReply - Explain the remote environment setup
Local Development Loop
- Build —
npm run build - Install to a plugin directory:
# Per-project (for testing)cp -r my-plugin/ <project>/.codeboltPlugins/my-plugin/# Or globalcp -r my-plugin/ ~/.codebolt/plugins/my-plugin/
- Reload in Plugins panel (click Reload), then Start
- Iterate — run
npx tsc --watch, stop/restart from Plugins panel after each rebuild
Publish
codebolt plugin publish --path ./my-plugin
List published plugins:
codebolt plugin list
Common Mistakes
| Mistake | Fix |
|---|---|
Missing codebolt.plugin in package.json | Server won't recognize as a plugin |
Forgetting to build dist/index.js | Always npm run build before loading |
| Storing config in filesystem | Use plugin.kvStore for persistence |
Not handling onStop() cleanup | Leads to dangling connections, leaked subscriptions |
Using startup trigger for chat gateway plugins that need config | Use manual — auto-load saved config in onStart |
Using @codebolt/client-sdk instead of @codebolt/plugin-sdk | Client SDK is for standalone UIs, plugin SDK is for server extensions |