griffinmartin/opencode-claude-auth
An authentication provider plugin that lets OpenCode reuse existing Claude Code credentials to access Anthropic's API.

Velocity · 7d
+13
★ / day
Trend
→steady
star history
This plugin registers a custom auth handler with OpenCode that intercepts Anthropic API requests. It retrieves OAuth tokens from macOS Keychain or a credentials file, caches them with a 30-second TTL, and automatically handles token refresh via Anthropic’s OAuth endpoint or Claude CLI fallback. The plugin also syncs credentials to OpenCode’s auth.json as a fallback mechanism and supports background re-sync every 5 minutes.