anomalyco / anomalyco/opencode
Config parse errors echo the substituted text, not the file as written
Open
@rekram1-node is already working on this.
Since Aug 13, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Hit this while fixing a typo in my opencode.json.
I had a syntax error (forgot the value after "model":) and the config uses
{env:DEMO_KEY} for the API key. The error under "--- JSONC Input ---" printed
my config back with the actual key value where {env:DEMO_KEY} was.
I'd expect it to quote the file the way I wrote it. tui.json goes through the
same path, and that one ends up in ~/.local/share/opencode/log/opencode.log.
Plugins
No response
OpenCode version
1.18.18
Steps to reproduce
- Put this in opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": { "anthropic": { "options": { "apiKey": "{env:DEMO_KEY}" } } },
"model":
} - DEMO_KEY=sk-live-DO-NOT-PRINT opencode run "hi"
- Look at the block under "--- JSONC Input ---" - the apiKey line shows
sk-live-DO-NOT-PRINT instead of {env:DEMO_KEY}, and the reported line
number doesn't match the file.
Screenshot and/or share link
Operating System
macOS 26.0.1
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.