[PR #7563] feat(opencode) plugin commands #12441

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

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

State: open
Merged: No


feat: Plugin Commands - Allow plugin tools to be exposed as slash commands

Summary

This PR adds a new experimental feature that allows plugin tools to optionally appear as slash commands in the autocomplete, with support for direct execution (without AI processing).

Problem

Currently, plugin tools can only be invoked by the AI. Users cannot directly invoke plugin functionality from the command input without going through the AI, which:

  • Adds latency and token costs for simple operations
  • Requires AI involvement for tasks that don't need it
  • Limits plugin utility for status checks, statistics, and other quick queries

Backwards Compatibility

  • Fully backwards compatible - Existing plugins work unchanged
  • command defaults to false, so existing tools remain AI-only
  • Feature is behind experimental.pluginCommands flag
  • Plugin tools are still registered in ToolRegistry regardless of command setting

Related Issues

This PR also includes a fix for plugin tool registration timing (ToolRegistry.state() now initializes after Plugin.init() in bootstrap.ts).

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7563 **State:** open **Merged:** No --- # feat: Plugin Commands - Allow plugin tools to be exposed as slash commands ## Summary This PR adds a new experimental feature that allows plugin tools to optionally appear as slash commands in the autocomplete, with support for direct execution (without AI processing). ## Problem Currently, plugin tools can only be invoked by the AI. Users cannot directly invoke plugin functionality from the command input without going through the AI, which: - Adds latency and token costs for simple operations - Requires AI involvement for tasks that don't need it - Limits plugin utility for status checks, statistics, and other quick queries ## Backwards Compatibility - **Fully backwards compatible** - Existing plugins work unchanged - `command` defaults to `false`, so existing tools remain AI-only - Feature is behind `experimental.pluginCommands` flag - Plugin tools are still registered in ToolRegistry regardless of `command` setting ## Related Issues This PR also includes a fix for plugin tool registration timing (ToolRegistry.state() now initializes after Plugin.init() in bootstrap.ts).
yindo added the pull-request label 2026-02-16 18:17:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12441