Skip to main content
xbot
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage
Edit page

Plugin System

xbot’s plugin system provides VSCode-like extensibility through a unified architecture supporting multiple runtimes (native Go, stdio/gRPC, script, and future WASM). Plugins can contribute tools, hooks, widgets, context enrichers, commands, themes, channel providers, and web UI extensions.

Key Features

  • Multiple Runtimes: Native Go plugins, stdio/gRPC plugins (any language), script plugins (bash), and WASM (planned)
  • Declarative Manifests: Each plugin declares its capabilities via plugin.json
  • Permission System: Fine-grained capability control — plugins only access what they declare
  • Hook System: Pre/post tool use, session lifecycle, user prompt, and custom events
  • Widget System: CLI status bar, title bar, info bar, and footer widgets
  • Web Plugin v2: Type-safe ESM frontend plugins with declarative UI contributions
  • Channel Plugins: Full channel adapters (e.g., GenUI display_html) via stdio protocol
  • Event Bus: Plugin-to-plugin pub/sub communication
  • KV Storage: Per-plugin persistent key-value storage
  • Hot Reload: Configuration-driven plugin activation/deactivation
  • Auto-retry: Exponential backoff for failed plugins
  • Dependency Resolution: Topological sort with cycle detection

Documentation Sections

Quick Example

A minimal script plugin (plugin.json):

{
  "id": "my-plugin",
  "name": "My Plugin",
  "version": "1.0.0",
  "runtime": "script",
  "entry": "bash main.sh",
  "activationEvents": ["onStart"],
  "permissions": ["ui.contribute"],
  "contributes": {
    "ui": [
      {
        "id": "greeting",
        "slot": "statusBarRight",
        "description": "Show a greeting"
      }
    ]
  }
}

The script main.sh:

#!/bin/bash
echo "Hello from my plugin!"

Place both files in ~/.xbot/plugins/my-plugin/ and restart xbot. The greeting appears in the status bar.