[PR #29] [MERGED] feat: Add tool restriction flags for non-interactive mode #9508

Closed
opened 2026-02-16 18:13:40 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/29
Author: @ezynda3
Created: 5/17/2025
Status: Merged
Merged: 5/17/2025
Merged by: @adamdotdevin

Base: devHead: allow-exclude-tools


📝 Commits (8)

  • 666986d Implement --allowedTools/--excludedTools
  • 2e83e94 Implement --verbose in non-interactive mode
  • f4aa592 refactor: extract non-interactive mode logic into separate file
  • 8b8f90a use charm for logging
  • bdb3270 fix permissions in non-interactive mode
  • 3f3ef86 use theme for spinner
  • db45d5c Update README with new tool restriction flags for non-interactive mode
  • 1296aa8 remove local binary

📊 Changes

7 files changed (+372 additions, -105 deletions)

View changed files

📝 .gitignore (+2 -1)
📝 README.md (+29 -8)
cmd/non_interactive_mode.go (+292 -0)
📝 cmd/root.go (+17 -96)
📝 go.mod (+5 -0)
📝 go.sum (+2 -0)
📝 internal/tui/components/spinner/spinner.go (+25 -0)

📄 Description

Summary

  • Add --allowedTools and --excludedTools flags to restrict which tools the AI assistant can use in non-interactive mode
  • Add --verbose flag to enable logging to stderr in non-interactive mode
  • Update README with documentation for the new flags

Test plan

  • Run OpenCode in non-interactive mode with --allowedTools=view,ls,glob to verify only those tools are available
  • Run OpenCode in non-interactive mode with --excludedTools=bash,edit to verify those tools are not available
  • Run OpenCode in non-interactive mode with --verbose to verify logs are printed to stderr

🤖 Generated with opencode


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/29 **Author:** [@ezynda3](https://github.com/ezynda3) **Created:** 5/17/2025 **Status:** ✅ Merged **Merged:** 5/17/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `allow-exclude-tools` --- ### 📝 Commits (8) - [`666986d`](https://github.com/anomalyco/opencode/commit/666986d8a943d2754e14cff902310dc3f2bb1a7e) Implement --allowedTools/--excludedTools - [`2e83e94`](https://github.com/anomalyco/opencode/commit/2e83e942e9a0d143b6e23407da9d96f244bec815) Implement --verbose in non-interactive mode - [`f4aa592`](https://github.com/anomalyco/opencode/commit/f4aa5927b4996cd8233da63ae2c792056a5c78aa) refactor: extract non-interactive mode logic into separate file - [`8b8f90a`](https://github.com/anomalyco/opencode/commit/8b8f90aabb3cb03b5d8480af21e172e64d72c1b0) use charm for logging - [`bdb3270`](https://github.com/anomalyco/opencode/commit/bdb327013a1bd32bb52e2d104d70f36b5ee6a6eb) fix permissions in non-interactive mode - [`3f3ef86`](https://github.com/anomalyco/opencode/commit/3f3ef8676be43f629185aa333fdf036612a18afc) use theme for spinner - [`db45d5c`](https://github.com/anomalyco/opencode/commit/db45d5cc4d642f5368ef2384b9d0bcb898f3b373) Update README with new tool restriction flags for non-interactive mode - [`1296aa8`](https://github.com/anomalyco/opencode/commit/1296aa8a921a2613d83d5efeefe6af6c7219b1f0) remove local binary ### 📊 Changes **7 files changed** (+372 additions, -105 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -1) 📝 `README.md` (+29 -8) ➕ `cmd/non_interactive_mode.go` (+292 -0) 📝 `cmd/root.go` (+17 -96) 📝 `go.mod` (+5 -0) 📝 `go.sum` (+2 -0) 📝 `internal/tui/components/spinner/spinner.go` (+25 -0) </details> ### 📄 Description ## Summary - Add `--allowedTools` and `--excludedTools` flags to restrict which tools the AI assistant can use in non-interactive mode - Add `--verbose` flag to enable logging to stderr in non-interactive mode - Update README with documentation for the new flags ## Test plan - Run OpenCode in non-interactive mode with `--allowedTools=view,ls,glob` to verify only those tools are available - Run OpenCode in non-interactive mode with `--excludedTools=bash,edit` to verify those tools are not available - Run OpenCode in non-interactive mode with `--verbose` to verify logs are printed to stderr 🤖 Generated with opencode --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:40 -05:00
yindo closed this issue 2026-02-16 18:13:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9508