-
Notifications
You must be signed in to change notification settings - Fork 9k
Description
Description
I tried to configure disabled_providers. One can read about
~/.config/opencode/config.json~/.config/opencode/opencode.json
but strace shows that opencode looks at the following places:
~/.config/opencode/config.json~/.config/opencode/opencode.json~/.config/opencode/opencode.jsonc$PWD/opencode.jsonc# folder where i started opencode~/opencode.jsonc/home/opencode.jsonc/opencode.jsonc$PWD/opencode.json# folder where i started opencode~/opencode.json/home/opencode.json/opencode.json
/opencode.json wins, so if i centrally provide /opencode.json, i override the user specific setting - this is fine.
But /opencode.json?! Why not /etc/...?
I wonder if the paths are intentional. From my point of view, it might make more sense that way:
~/.config/opencode/config.jsonor$HOME/.config/opencode/opencode.json$PWD/opencode.json/etc/opencode.jsonor/etc/opencode/opencode.jsonor/etc/opencode/config.json
To clear up the confusion surrounding opencode.json vs. config.json, I would probably opt for opencode.json (which can be found in the documentation e.g. https://opencode.ai/docs/rules/#custom-instructions) - so maybe:
$HOME/.config/opencode/opencode.json$PWD/opencode.json# by this I mean the project folder in which opencode works./etc/opencode.jsonor/etc/opencode/opencode.json
The latter ones shoud always override the former ones (merge).
I used a bug report since /opencode.json is not the correct place for a central configuration in my opinion.
OpenCode version
0.15.16
Steps to reproduce
strace -fo log opencode# exit after startgrep -oE '/.*(config|opencode).json[^"]*' log
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response