

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Learn AI Coding
incomplete
2: Chat, Autocomplete, and Agents
incomplete
3: Installing OpenCode
incomplete
4: OpenCode Console
incomplete
5: The Unix Philosophy
incomplete
6: OpenCode Config
incomplete
7: CLI Config
incomplete
8: OpenCode Run
incomplete
9: GUI Clients
incomplete
10: Mobile Usage
incomplete
11: Remote Server
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
opencode.jsonc is OpenCode's main runtime config file. It controls things like:
For example, this config selects the opencode/deepseek-v4.1-flash-free model and forces the agent to ask for permission before ever running git push:
{
"$schema": "https://opencode.ai/config.json",
"model": "opencode/deepseek-v4.1-flash-free",
"permissions": [
{
"action": "shell",
"resource": "git push *",
"effect": "ask",
},
],
}
The $schema field gives compatible editors validation and autocomplete features.
And if you didn't know, JSONC is "JSON with Comments" (and trailing commas). Alternatively, you can use opencode.json if convenience change is scary.
OpenCode merges configuration from multiple locations. Your personal, global config is stored in your home directory:
~/.config/opencode/opencode.jsonc
Then you can optionally also have a project-level opencode.jsonc in a repo's root for shared project-specific settings. Project values override matching global values, while unrelated settings from both files remain active.
Project-level configuration is designed to be checked in. We made it so that you can avoid putting credentials in there. It's for things that you want to apply for your whole team. Any personal settings should go in your global config.
Use {env:VARIABLE} or {file:path} to substitute credentials without committing them. For example:
{
"providers": {
"anthropic": {
"settings": {
"apiKey": "{env:ANTHROPIC_API_KEY}",
},
},
"openai": {
"settings": {
"apiKey": "{file:~/.secrets/openai-key}",
},
},
},
}
Configure OpenCode so it can run and submit your bootdev CLI checks without asking for permission.
- "action": "shell"
- "resource": "bootdev run *"
- "effect": "allow"
Submit the tests with OpenCode. Confirm that it runs the CLI directly.