[PR #6389] feat(plugin): add sidebar panel API for plugins #11874

Open
opened 2026-02-16 18:16:48 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6389

State: open
Merged: No


Summary

Adds a plugin API that allows plugins to register custom panels in the sidebar.

Closes #5971

Changes

  • Add SidebarPanel and SidebarPanelItem types to @opencode-ai/plugin
  • Add sidebar hook for plugins to register panels
  • Add GET /plugin/sidebar server endpoint
  • Add Plugin.getSidebarPanels() to aggregate panels from all plugins
  • Render plugin panels in sidebar with collapse/expand support
  • Poll every 5 seconds for dynamic updates

Usage

import { definePlugin } from "@opencode-ai/plugin"

export default definePlugin({
  name: "my-plugin",
  hooks: {
    sidebar: [
      {
        id: "status",
        title: "My Plugin Status",
        items: [
          { label: "Version", value: "1.0.0" },
          { label: "Status", value: "Active", status: "success" }
        ]
      }
    ]
  }
})

Both sidebar and items can be functions for dynamic content.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6389 **State:** open **Merged:** No --- ## Summary Adds a plugin API that allows plugins to register custom panels in the sidebar. Closes #5971 ## Changes - Add `SidebarPanel` and `SidebarPanelItem` types to `@opencode-ai/plugin` - Add `sidebar` hook for plugins to register panels - Add `GET /plugin/sidebar` server endpoint - Add `Plugin.getSidebarPanels()` to aggregate panels from all plugins - Render plugin panels in sidebar with collapse/expand support - Poll every 5 seconds for dynamic updates ## Usage ```typescript import { definePlugin } from "@opencode-ai/plugin" export default definePlugin({ name: "my-plugin", hooks: { sidebar: [ { id: "status", title: "My Plugin Status", items: [ { label: "Version", value: "1.0.0" }, { label: "Status", value: "Active", status: "success" } ] } ] } }) ``` Both `sidebar` and `items` can be functions for dynamic content.
yindo added the pull-request label 2026-02-16 18:16:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11874