Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat: add --tools flag to limit available tools#5339

Open
paralin wants to merge 1 commit intoanomalyco:devanomalyco/opencode:devfrom
paralin:tools-flagparalin/opencode:tools-flagCopy head branch name to clipboard
Open

feat: add --tools flag to limit available tools#5339
paralin wants to merge 1 commit intoanomalyco:devanomalyco/opencode:devfrom
paralin:tools-flagparalin/opencode:tools-flagCopy head branch name to clipboard

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()

Fixes #9386

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()

Fixes: anomalyco#9386

Signed-off-by: Christian Stewart <christian@aperture.us>
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

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.

[FEATURE]: specify --tools on command-line for enabling/disabling tools

1 participant

Comments

Close sidebar
Morty Proxy This is a proxified and sanitized view of the page, visit original site.