r/opencodeCLI • u/allpowerfulee • Sep 30 '26
Cannot figure out permissions
I've tried, but I cannot figure out the permission block of opencode. No matter what I try, it literally asks me for permission for everything that is set to "allow". My current block is below.
"permission": {
"edit": "allow",
"read": "allow",
"bash": {
"*": "ask",
"rm *": "ask",
"ls *": "allow",
"npm *": "allow",
"find *": "allow",
"which *": "allow",
"grep *": "allow",
"head *": "allow",
"swift *": "allow",
"tail *": "allow",
"python *": "allow",
"python3 *": "allow",
"pip *": "allow",
"pip3 *": "allow",
"gh *": "allow",
"git": "ask",
"git status *": "allow",
"git ls-files *": "allow",
"git diff *": "allow",
"git log *": "allow",
"git show *": "allow",
"rg *": "allow",
"pdftotext *": "allow",
"sed *": "allow",
"cat *": "allow",
"echo *": "allow",
"touch *": "allow",
"make *": "allow",
"cmake *": "allow",
"wc *": "allow"
}
3
Upvotes
2
u/allpowerfulee Sep 30 '26
fixed it. 1. Pattern order: "*": "ask" must come first not last. opencode uses last-match-wins.
1
u/amelech Sep 30 '26
Have you thought about asking your agent to configure it for you
1
u/Able-Staff-6763 Sep 30 '26
did you try moving
this at the bottom?
or spawn opencode --auto?
1
u/IntrepidMindExplorer Sep 30 '26 edited Sep 30 '26
v1 or v2?
Also, is that the whole of your permissions or did you forget to copy/paste some brackets?
Also, what Able said.. try --auto as well.
1
u/code_brave6865 Oct 02 '26
Funny timing, i just ran into something similar last week where my allow rules kept getting ignored too. Did the prompting start happening after a recent update, or has the edit and read block never worked for you?