anomalyco / anomalyco/opencode
Misconfigured OPENCODE_CONFIG / OPENCODE_CONFIG_DIR crash with errors
@jlongster is already working on this.
Since Aug 12, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Bad values for the config env vars kill opencode at startup with errors that don't say what's wrong
Plugins
No response
OpenCode version
1.18.15
Steps to reproduce
➜ opencode git:(dev) OPENCODE_CONFIG=/tmp/ opencode models
Error: Unexpected error
BadResource: FileSystem.readFile (/tmp/)
➜ opencode git:(dev) OPENCODE_CONFIG_DIR=/Users/user/.config/opencode/opencode.json opencode models
Error: Unexpected error
BadResource: FileSystem.readFile (/Users/user/.config/opencode/opencode.json/opencode.json)
➜ opencode git:(dev) OPENCODE_CONFIG_DIR=/does/not/exists opencode models
Error: Unexpected error
Unknown: FileSystem.makeDirectory (/does/not/exists)
### Screenshot and/or share link
_No response_
### Operating System
_No response_
### Terminal
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.