English
Build a plugin
Take a Python function your team already relies on, expose it behind ReliaForge authentication, and attach a console page when operators need a UI. The backend's step-by-step tutorial walks through a runnable service-ownership lookup API with complete files.
What you will get
After wiring the example router, calling:
bash
curl "http://127.0.0.1:8000/api/v1/plugins/sample_tool/owner?service_name=payments"returns:
json
{"service": "payments", "team": "payments-ops"}Files to touch
Generate sample_tool from Quick start, then edit only what your tool needs:
| Goal | File or setting | Action |
|---|---|---|
| Add your logic | ownership.py | Put your lookup or automation function here |
| Expose an endpoint | router.py | Parse inputs with FastAPI, call the function, return JSON |
| Configure via env vars | settings.py | Subclass PluginSettings to read RELIAFORGE_SAMPLE_TOOL_* |
| Load in dev | RELIAFORGE_PLUGIN_PATHS | Point to ./local-plugins and restart reliaforge |
| Add a console page (optional) | manifest.json (frontend) | Bundle an ESM workspace with @reliaforge/plugin-sdk |
plugin.py generated by the scaffold already hooks up initialization, startup, shutdown, and health checks. See the complete backend plugin guide when your tool opens async HTTP pools, WebSockets, or background tasks.
Verify the failure cases
Run three checks before shipping:
- Valid input returns HTTP
200. - Missing or unknown input returns HTTP
404or422(never a raw500traceback). - Stop
sample_toolin the console and repeat the request; it must return HTTP503. Start it again and confirm200returns without restarting the backend process.
In local development, browse generated OpenAPI routes at http://127.0.0.1:8000/api/v1/docs.
Package and share
- Installable Python package: Add an entry under
[project.entry-points."reliaforge.plugins"]inpyproject.tomlandpip installit into the backend environment. Browsereliaforge-pluginsfor six production examples combining Python routers with@reliaforge/plugin-sdkviews. - Mounted folder: Copy the plugin directory to the server, install its Python requirements, and add the parent directory to
RELIAFORGE_PLUGIN_PATHS.
For minimal service sharing between two plugins, read the bundled demo and runbook plugins.
