Skip to content

Conversation

@paralin
Copy link
Contributor

@paralin paralin commented Dec 10, 2025

Add --tools flag to serve, web, and TUI commands to enable selective tool access control. The flag accepts comma-separated patterns to enable/disable tools.

Usage examples:

  # Only allow read, write, and webfetch tools
  opencode serve --tools='-*,read,write,webfetch'

  # Disable specific tools
  opencode web --tools='-bash,-edit'

  # Use in TUI mode
  opencode --tools='-*,read,write,webfetch'

Changes:

  • Add --tools flag to serve, web, and TUI thread commands
  • Implement Wildcard.parseToolsPattern() to parse tool enable/disable patterns
  • Update Server.listen() to accept tools option
  • Pass default tools to SessionPrompt.prompt() in server
  • Add tests for parseToolsPattern()

Add --tools flag to serve, web, and TUI commands to enable selective tool access
control. The flag accepts comma-separated patterns to enable/disable tools.

Usage examples:

  # Only allow read, write, and webfetch tools
  opencode serve --tools='-*,read,write,webfetch'

  # Disable specific tools
  opencode web --tools='-bash,-edit'

  # Use in TUI mode
  opencode --tools='-*,read,write,webfetch'

Changes:
- Add --tools flag to serve, web, and TUI thread commands
- Implement Wildcard.parseToolsPattern() to parse tool enable/disable patterns
- Update Server.listen() to accept tools option
- Pass default tools to SessionPrompt.prompt() in server
- Add tests for parseToolsPattern()

Signed-off-by: Christian Stewart <[email protected]>
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