Skip to content

Per-plugin toggle for exposing CLI commands to agents (plugin-commands skill curation) - #2739

Open
swairshah wants to merge 1 commit into
get-bb:mainfrom
swairshah:plugin-agent-cli-toggle
Open

Per-plugin toggle for exposing CLI commands to agents (plugin-commands skill curation)#2739
swairshah wants to merge 1 commit into
get-bb:mainfrom
swairshah:plugin-agent-cli-toggle

Conversation

@swairshah

Copy link
Copy Markdown

Problem

Every plugin that registers a CLI shows up in the server-generated plugin-commands skill, so agents see all plugin commands. As the plugin count grows this becomes noise: not every plugin's commands are useful to agents, and today the only way to hide them is disabling the plugin entirely.

Change

Adds a per-plugin agent CLI exposure toggle (default: exposed, preserving current behavior). A hidden plugin keeps a fully working CLI — its commands are just omitted from the generated plugin-commands skill, so agents never discover them.

  • DB: plugins.agent_cli_exposed boolean column (migration 0110_plugin_agent_cli_exposed), preserved across reinstalls/updates and state-snapshot rollbacks.
  • Server: cliContributions() filters hidden plugins before writing the skill; PluginService.setAgentCliExposed() re-syncs the skill and broadcasts plugins-changed. New route POST /api/v1/plugins/:id/agent-cli with { exposed: boolean }.
  • CLI: bb plugin agent-cli <id> [on|off] shows or sets the toggle; bb plugin list marks hidden commands with "(hidden from agents)".
  • SDK: plugins.setAgentCliExposed(); InstalledPlugin.agentCliExposed (schema default true, so older servers parse fine).
  • App: an "Agent access" section with a switch on the plugin detail page, shown when the plugin registers a CLI command.
  • Docs: bb-cli command index + plugins reference, plugin guide template, and the plugin-authoring skill's CLI chapter.

Tests

  • New server test: toggling off removes the plugin's section from the skill (and removes the skill file when no contributions remain), the command stays runnable, toggling back regenerates it, plus 400/404 request validation.
  • Migration rewind tests updated with a drop agent_cli_exposed helper, mirroring the existing pattern.
  • Full turbo run typecheck (80 tasks) passes; db/sdk/cli/server plugin suites and app plugin component tests pass. The only failing test locally is install-machine-script.test.ts, which also fails on a clean main checkout (environment-dependent).

…ds skill

Users can now curate which plugins advertise their bb CLI commands to
agents. A new agent_cli_exposed column (default on) is read when the
server generates the plugin-commands skill; a hidden plugin's commands
keep working but are omitted from the skill, so agents never see them.

- bb plugin agent-cli <id> [on|off] shows or sets the toggle from the CLI
- POST /api/v1/plugins/:id/agent-cli sets it over HTTP; the SDK exposes
  plugins.setAgentCliExposed and InstalledPlugin.agentCliExposed
- The plugin detail page gets an Agent access section with a switch,
  shown when the plugin registers a CLI command
- Reinstalls and updates preserve the user's choice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant