Where to configure a global opencode.json? #180

Closed
opened 2026-02-16 17:25:36 -05:00 by yindo · 2 comments
Owner

Originally created by @AlexW00 on GitHub (Jun 20, 2025).

In the readme, it states that in order to use OpenRouter, one must configure a file called opencode.json

I tried placing such a file in:

  • ~/.config/opencode
  • ~/.config/opencode/providers
  • ~/.local/share/opencode

but none of these files had any effect

only when i added opencode.json in the root of the currend working dir, it worked

however, this is super annoying since openrouter wont work with openrouter again when using another working-dir

is there any other place one could configure opencode.json (globally)?

Originally created by @AlexW00 on GitHub (Jun 20, 2025). In the readme, it states that in order to use OpenRouter, one must configure a file called `opencode.json` I tried placing such a file in: - ~/.config/opencode - ~/.config/opencode/providers - ~/.local/share/opencode but none of these files had any effect only when i added `opencode.json` in the root of the currend working dir, it worked however, this is super annoying since openrouter wont work with openrouter again when using another working-dir is there any other place one could configure `opencode.json` (globally)?
yindo closed this issue 2026-02-16 17:25:36 -05:00
Author
Owner

@cravenceiling commented on GitHub (Jun 20, 2025):

The file must be named config.json if placed in ~/.config/opencode/config.json. Here is the docs.

@cravenceiling commented on GitHub (Jun 20, 2025): The file must be named `config.json` if placed in `~/.config/opencode/config.json`. [Here](https://opencode.ai/docs/config/) is the docs.
Author
Owner

@AlexW00 commented on GitHub (Jun 20, 2025):

thank you, that did the job

@AlexW00 commented on GitHub (Jun 20, 2025): thank you, that did the job
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#180