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
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
{
"$schema": "https://opencode.ai/config.json",
"provider": { "anthropic": { "options": { "apiKey": "{env:DEMO_KEY}" } } },
"model":
}
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