
OpenCode reads its configuration from more than one place. Put the MozOut provider in the global file and it shows in every project. Put it in a project's file and it only shows when you open OpenCode in that folder. Both can exist at the same time.
Where each file goes
| For | File |
| All projects (Linux and macOS) | ~/.config/opencode/opencode.jsonc (or .json) |
| One project only (Windows, macOS and Linux) | opencode.jsonc or .opencode/opencode.jsonc, in the project folder |
OpenCode accepts .json and .jsonc. Use .jsonc if you want comments or a comma after the last item. OpenCode looks for the project file from the folder where you open it up to the root of the disk, so the file of a parent folder also counts.
The OpenCode documentation does not give the folder of the global file on Windows. The current documentation has the command opencode debug paths config, which shows the configuration folder on your computer. If in doubt, on Windows use the project file, which works the same.
When both exist
OpenCode joins the files. Everything that does not clash is kept. When the same setting is in both, the project file wins over the global one, and the closest project file wins over one in a parent folder. In the same folder, .opencode/opencode.jsonc wins over opencode.jsonc.
An example: the provider is in the global file and, in one project, there is only the line "model": "api/zai-org/glm-5.2". In that project, OpenCode starts with GLM 5.2. In the others, it starts with the model in the global file.
Company computers may also have a system file (on Linux, in /etc/opencode) that wins over all the others. If one of your settings has no effect, check with whoever manages the computer.
Which one to use
|
|
|
Creating the file
Global, on Linux and macOS:
mkdir -p ~/.config/opencode
nano ~/.config/opencode/opencode.jsonc
For a project, on Windows, in PowerShell, inside the project folder:
notepad opencode.jsonc
The content is the same in both: it is in OpenCode with All in One AI. After you change either of them, close OpenCode completely and open it again.
| The project file usually goes into the repository. Never write the key there: use {env:MOZOUT_API_KEY}, which only holds the variable name. |
|
Want our models in all your projects? Visit the Coding with AI page. See Coding with AI |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from $6.60/mo (3-year plan, with coupon) See plans |











