Skip to content

[FEATURE]: add startServer() to PluginInput #21769

@micuintus

Description

@micuintus
  • I've checked that this feature hasn't been suggested before.

TL;DR

Expose a startServer() function on PluginInput so plugins can programmatically start the opencode HTTP server on demand.

More detail

Plugins that need to interact with the opencode server API (e.g. to inject tool results or report status) currently have no way to ensure the server is running. The server is normally only started when the TUI or server CLI command is used.

Adding startServer() to PluginInput lets plugins lazily start the server when they need it. The function is idempotent — calling it multiple times returns the same server instance.

The type is also exported from the @opencode/plugin package.

Part of the plugin primitives work tracked in #20018 (split from #21687).

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions