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
{{ message }}
Repository navigation
Docs miss mentioning XDG base directories for global configuration while already supporting them #6669
In the configuration documentation, it is only stated that the global configuration file is located at ~/.config/opencode/opencode.json. However, in cases where the XDG_CONFIG_HOME environment variable is set, OpenCode will look up the global configuration file in XDG_CONFIG_HOME/opencode/opencode.json. This also applies for all other global configurations and files.
It is amazing that opencode supports the XDG spec. I just came across this misinformation in the docs because I couldn't get my global configuration file to work (I have a different folder set as my XDG config home). IMHO, this should be aligned better in the docs, although I understand that many users won't know of XDG base directory variables.
OpenCode version
v1.0.223
Steps to reproduce
Place a file with custom configuration in ~/.config/opencode/opencode.json
Run opencode with a custom XDG_CONFIG_HOME environment variable set (e.g., export XDG_CONFIG_HOME="$HOME/.imaginary-folder"
Observe how the global configuration in ~/.config/opencode/opencode.json does not have any effect anymore and $HOME/.imaginary-folder/opencode has been created.
I apologize for missing the discussion in #4170 which seems to partially relate to my concerns. However, I am not convinced that that big of a change is necessary, as stated in the issue description above. Hence, I wouldn't call this a duplicate.
I created a draft PR with a proposal on how to mention both the XDG base directory spec as well as the used default of ~/.config/opencode here: #6670
As a side note, bug might not be the appropriate label for this issue; it should rather only be docs.
The docs are still incorrect to this day, but I understand that interest in such minor details is low at the current time because of the high velocity in other areas.
Activity
github-actions commentedon Jan 2, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
pwuersch commentedon Jan 2, 2026
I apologize for missing the discussion in #4170 which seems to partially relate to my concerns. However, I am not convinced that that big of a change is necessary, as stated in the issue description above. Hence, I wouldn't call this a duplicate.
I created a draft PR with a proposal on how to mention both the XDG base directory spec as well as the used default of
~/.config/opencodehere: #6670As a side note,
bugmight not be the appropriate label for this issue; it should rather only bedocs.github-actions commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
pwuersch commentedon Mar 25, 2026
The docs are still incorrect to this day, but I understand that interest in such minor details is low at the current time because of the high velocity in other areas.
fix(init): resolve the OpenCode global path properly and guard the block