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

Open
opened 2026-02-16 18:05:15 -05:00 by yindo · 3 comments
Owner

Originally created by @paralin on GitHub (Jan 19, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

When running with opencode run I want to be able to specify --tools '-*,read,write,webfetch' to define which tools the model can use. The proposed syntax is -* (disable all), or enable by listing them, or * to enable all. See #5339

Originally created by @paralin on GitHub (Jan 19, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request When running with `opencode run` I want to be able to specify `--tools '-*,read,write,webfetch'` to define which tools the model can use. The proposed syntax is -* (disable all), or enable by listing them, or * to enable all. See #5339
yindo added the discussion label 2026-02-16 18:05:15 -05:00
Author
Owner

@paralin commented on GitHub (Jan 19, 2026):

#5339

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'
@paralin commented on GitHub (Jan 19, 2026): #5339 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' ```
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9320: Support JSON schema as a constraint of opencode run command (similar CLI-based tool control)
  • #8936: Bash default permission is 'allow' (related to tool/permission default behavior)
  • #8463: Add --dangerously-skip-permissions YOLO mode (related to selective tool/permission control)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of existing issues. Please check: - #9320: Support JSON schema as a constraint of opencode run command (similar CLI-based tool control) - #8936: Bash default permission is 'allow' (related to tool/permission default behavior) - #8463: Add `--dangerously-skip-permissions` YOLO mode (related to selective tool/permission control) Feel free to ignore if none of these address your specific case.
Author
Owner

@smola commented on GitHub (Jan 24, 2026):

This would be very useful, but to be fully functional, it should probably support bash patterns. Something like --tools '-*,bash/ls*,bash/cat*'.

@smola commented on GitHub (Jan 24, 2026): This would be very useful, but to be fully functional, it should probably support bash patterns. Something like `--tools '-*,bash/ls*,bash/cat*'`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6781