Problem
On Linux setups where OpenCode uses a custom XDG_DATA_HOME, this plugin syncs Anthropic OAuth creds to ~/.local/share/opencode/auth.json instead of the active OpenCode data dir.
Repro
- Set
XDG_DATA_HOME to a non-default path (example: /home/user/work/.local/share).
- Use
opencode-claude-auth@latest with valid Claude credentials (~/.claude/.credentials.json).
- Run OpenCode and check providers.
Observed
- Plugin debug log shows writes to
~/.local/share/opencode/auth.json.
- OpenCode reads credentials from
$XDG_DATA_HOME/opencode/auth.json.
- Anthropic provider/models are missing until manual copy is done.
Expected
Plugin should write to $XDG_DATA_HOME/opencode/auth.json on non-Windows (with fallback to ~/.local/share/opencode/auth.json when XDG_DATA_HOME is unset).
Notes
This also affects persisted account source path (claude-account-source.txt) for the same reason.
I have a fix ready and can open PR.
Problem
On Linux setups where OpenCode uses a custom
XDG_DATA_HOME, this plugin syncs Anthropic OAuth creds to~/.local/share/opencode/auth.jsoninstead of the active OpenCode data dir.Repro
XDG_DATA_HOMEto a non-default path (example:/home/user/work/.local/share).opencode-claude-auth@latestwith valid Claude credentials (~/.claude/.credentials.json).Observed
~/.local/share/opencode/auth.json.$XDG_DATA_HOME/opencode/auth.json.Expected
Plugin should write to
$XDG_DATA_HOME/opencode/auth.jsonon non-Windows (with fallback to~/.local/share/opencode/auth.jsonwhenXDG_DATA_HOMEis unset).Notes
This also affects persisted account source path (
claude-account-source.txt) for the same reason.I have a fix ready and can open PR.