Summary
Make Crabcode read and share authentication credentials from OpenCode so users can switch from OpenCode without re-entering provider credentials.
Motivation
Crabcode is intended to replace the Node-based OpenCode CLI and already reads OpenCode configuration files such as opencode.jsonc. However, authentication is currently stored separately at:
~/.local/state/crabcode/auth.json
OpenCode stores credentials at:
~/.local/share/opencode/auth.json
This requires users to authenticate again and creates duplicate credential stores.
Proposed solution
Adopt OpenCode's authentication file as Crabcode's canonical auth source:
- Read
$XDG_DATA_HOME/opencode/auth.json
- Default to
~/.local/share/opencode/auth.json
- Preserve existing Crabcode credentials through a one-time migration or safe fallback
- Ensure login, logout, and credential updates use the canonical OpenCode path
- Preserve secure file permissions and test isolation
Acceptance criteria
Summary
Make Crabcode read and share authentication credentials from OpenCode so users can switch from OpenCode without re-entering provider credentials.
Motivation
Crabcode is intended to replace the Node-based OpenCode CLI and already reads OpenCode configuration files such as
opencode.jsonc. However, authentication is currently stored separately at:~/.local/state/crabcode/auth.jsonOpenCode stores credentials at:
~/.local/share/opencode/auth.jsonThis requires users to authenticate again and creates duplicate credential stores.
Proposed solution
Adopt OpenCode's authentication file as Crabcode's canonical auth source:
$XDG_DATA_HOME/opencode/auth.json~/.local/share/opencode/auth.jsonAcceptance criteria
~/.local/share/opencode/auth.json