istro

Extend

Plugins

Add pages, apps and assistant tools with a folder and a plugin.json.

A plugin adds pages, apps and assistant tools to Bistro. It is a folder with a plugin.json and the files it names.

#Commands

bistro plugin list                 installed plugins
bistro plugin inspect SRC          what a folder, .tar.gz or https address asks for
bistro plugin install SRC          show the request, ask once, then install
bistro plugin enable|disable NAME  turn one on or off without removing it
bistro plugin remove NAME
bistro plugin new NAME             a starter folder

An install allows no symbolic links, https addresses only, 5 MB at most, and no paths that leave the folder.

#plugin.json

{
  "name": "example", "version": "1.0.0", "title": "Example", "description": "What it does.",
  "permissions": ["pages", "apps", "tools"],
  "pages": [{ "id": "example", "title": "Example", "icon": "star", "description": "...", "script": "page.js" }],
  "apps":  [{ "id": "example-whoami", "name": "Whoami", "image": "docker.io/traefik/whoami:latest", "web": 8089, "ports": ["8089:80"], "description": "...", "category": "Tools" }],
  "tools": [{ "name": "plugin_example_greet", "risk": "read", "description": "...", "command": ["bin/greet"], "input_schema": { "type": "object", "properties": {}, "additionalProperties": false } }]
}
  • permissions must list pages, apps and tools for each kind the plugin adds.
  • Tool names start with plugin_. risk is read, change or danger. The rules in the assistant settings still apply.
  • A tool command is relative to the plugin folder. The assistant sends its input as JSON on stdin. Print the answer on stdout.
  • Apps go through the same checks as the app catalog (plain container apps only).
  • A page script calls B.page("ID", { init, show, hide }). The dashboard creates <section id="page-ID"> and lists the page in the menu under Plugins.

A worked example is in docs/example-plugin/ in the repository.