Expand description
Single source of truth for locating OpenCode’s global config file.
OpenCode accepts both opencode.json and opencode.jsonc. lean-ctx used to
hardcode opencode.json in every writer, so a user whose config was
opencode.jsonc got a second, competing global config containing nothing
but the lean-ctx MCP entry and shadow-mode denies — their providers, models
and foreign MCP servers appeared to vanish (#1585).
Resolution rule, applied by init, setup, doctor, the shadow-mode
permission updater and uninstall alike:
- exactly one of the two exists → that file
- both exist →
opencode.json(OpenCode’s own default name), reported viaResolved::ambiguousso callers can warn instead of silently picking - neither exists →
opencode.json, to be created
Structs§
- Resolved
- Where the OpenCode config lives, plus whether the choice was ambiguous.
Functions§
- config_
dir - Resolve OpenCode’s global config directory.
- resolve
- Resolve the global OpenCode config for a given home directory.
- resolve_
in_ dir - Resolve the config inside an OpenCode config directory.