You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Hello everyone :)
Wondering if it was possible to allow opencode read on every file from a path, write only on cwd, and ask everywhere else? from a global config.
I've been searching on docs and i think not, because the closest thing will be adding edit to ask, but that will make opencode ask before writting on cwd too.
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the request, @AzazelHD!
I think you can already do this with config, without a new feature. Here is how OpenCode v2 treats paths:
editrules match them as relative paths.external_directorypermission (defaultask), and rules match it as an absolute path.*also matches/.So a global config (
~/.config/opencode/opencode.json) like this should do what you want:{ "$schema": "https://opencode.ai/config.json", "permission": { "read": "allow", "external_directory": { "*": "ask", "~/path/you/trust/**": "allow" }, "edit": { "*": "allow", "/*": "ask" } } }~/path/you/trust/**, reads are allowed without asking. Edits still ask, because the absolute path matches"/*": "ask".external_directory).A few caveats:
C:/..., so add a rule such as"?:*": "ask"toedit.bashcommands can still write files, so addbashrules if you need that to be strict too.More details are in the permissions docs. If this doesn't cover your case, please reply with what's missing and maintainers will consider it.
Tarquinen commentedon Nov 2, 2026
Thanks for the request! This can already be done with permission rules in your config, as described in the comment above. Closing this issue.
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊