Discover and explore top open-source AI tools and projects—updated daily.
ex-machina-coAnthropic authentication plugin for OpenCode IDE
Top 69.0% on SourcePulse
This plugin integrates Anthropic's OAuth authentication into the OpenCode development environment, allowing Claude Pro/Max subscribers to utilize their existing subscriptions directly. It targets OpenCode users seeking to leverage advanced AI models without incurring additional API costs, simplifying authentication and ensuring compatibility with Anthropic's platform requirements.
How It Works
The plugin employs a PKCE OAuth flow to authenticate users with Anthropic's services. It manages the exchange of authorization codes for access and refresh tokens, automatically handling token expiration and renewal. A key feature is its system prompt sanitization, which rewrites prompts to meet Claude Code's specific identity and formatting requirements, preserving user instructions while removing or modifying specific elements like the OpenCode identity and URLs. This approach ensures seamless integration and cost-effective usage by zeroing out model costs associated with the user's subscription.
Quick Start & Requirements
To use the plugin, add it to your OpenCode configuration:
{
"plugin": ["@ex-machina/opencode-anthropic-auth"]
}
It is strongly advised to pin the plugin version (e.g., "@ex-machina/opencode-anthropic-auth@1.7.0") to prevent unexpected automatic updates. The plugin supports three authentication methods: OAuth via claude.ai for Pro/Max users, OAuth via console.anthropic.com to create an API key, or manual API key entry. Environment variables ANTHROPIC_BASE_URL and ANTHROPIC_INSECURE can be used for proxying or skipping TLS verification. Local development can be initiated with bun run dev.
Highlighted Details
Maintenance & Community
The project utilizes changesets for version management and publishing, with CI automating release processes. No specific community links (e.g., Discord, Slack) or details on notable contributors or sponsorships are provided in the README.
Licensing & Compatibility
The project is released under the MIT license, which permits broad use, including commercial applications and linking within closed-source projects.
Limitations & Caveats
Users are strongly cautioned to pin plugin versions to mitigate security risks from automatic updates. For troubleshooting, the README suggests resetting the OpenCode configuration directory (~/.config/opencode) and verifying opencode.json. The system prompt sanitization, while resilient, may require adjustments if Anthropic's API requirements change significantly or if prompts are unusually complex.
5 days ago
Inactive
imbue-ai
griffinmartin
nanocoai