anomalyco / anomalyco/opencode

Misconfigured OPENCODE_CONFIG / OPENCODE_CONFIG_DIR crash with errors

Open
#42,116 1 comment 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.