-
Notifications
You must be signed in to change notification settings - Fork 6
Add OpenCode Anthropic OAuth Plugin Integration #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add OAuth authentication support for Claude Pro/Max accounts via the opencode-anthropic-auth plugin. Changes: - Created comprehensive documentation in tools/opencode/opencode-anthropic-auth.md - Three authentication methods (Pro/Max OAuth, API Key creation, Manual) - Setup instructions, troubleshooting, security considerations - Comparison with other auth methods - Updated opencode.md with Anthropic OAuth Plugin section - Added authentication commands to Quick Reference - Cross-referenced detailed documentation - Refactored setup.sh to support multiple plugins - Created add_opencode_plugin() helper function (DRY) - Added setup for opencode-anthropic-auth@latest - Enhanced user messaging with clear instructions - Updated AGENTS.md to reference new plugin Benefits for users: - Zero-cost API usage for Claude Pro/Max subscribers - OAuth 2.0 with PKCE for secure authentication - Automatic token refresh - Beta features auto-enabled (extended thinking, etc.) - No manual API key management Plugin repository: https://github.com/anomalyco/opencode-anthropic-auth Task: t048
WalkthroughDocumentation and configuration updates introducing Anthropic OAuth authentication support for the OpenCode plugin ecosystem. Includes comprehensive plugin documentation, authentication flow guidance, and refactored shell script helper function for centralized plugin configuration management. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances OpenCode's integration with Anthropic by introducing a dedicated OAuth authentication plugin. This allows users with Claude Pro/Max subscriptions to leverage their existing plans for zero-cost API access, benefiting from secure OAuth 2.0, automatic token refreshing, and immediate access to beta features. The underlying setup process has also been streamlined to support future plugin expansions. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Fri Jan 9 10:33:13 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces support for the opencode-anthropic-auth plugin, which is a valuable addition for Claude Pro/Max users. The changes are well-structured, including comprehensive documentation and a thoughtful refactoring of the setup.sh script to accommodate multiple plugins. My review includes one suggestion to further improve the new helper function in setup.sh for better maintainability and robustness. Overall, this is a high-quality contribution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
setup.sh (1)
1601-1638: Good DRY refactor with the helper function.The
add_opencode_plugin()helper nicely encapsulates the plugin addition logic, following thelocal var="$1"pattern per coding guidelines. However, an explicit return is missing at the end of the function.♻️ Add explicit return for consistency
print_success "Created plugin array with $plugin_name" fi + + return 0 }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.agent/AGENTS.md.agent/tools/opencode/opencode-anthropic-auth.md.agent/tools/opencode/opencode.mdsetup.sh
🧰 Additional context used
📓 Path-based instructions (2)
**/setup.sh
📄 CodeRabbit inference engine (AGENTS.md)
Deploy agents locally using ./setup.sh script
Files:
setup.sh
**/*.sh
📄 CodeRabbit inference engine (AGENTS.md)
**/*.sh: Use local var="$1" pattern for shell variable assignments
Use explicit returns in shell scripts
Run ShellCheck on all scripts with zero violations required
Files:
setup.sh
🧠 Learnings (6)
📚 Learning: 2026-01-06T15:57:56.008Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.008Z
Learning: Applies to **/AGENTS.md : Use progressive disclosure in AGENTS.md with pointers to subagents rather than inline content
Applied to files:
.agent/AGENTS.md
📚 Learning: 2025-11-29T04:34:42.033Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENT.md:0-0
Timestamp: 2025-11-29T04:34:42.033Z
Learning: Reference AGENTS.md (authoritative) instead of AGENT.md for AI assistant guidance
Applied to files:
.agent/AGENTS.md
📚 Learning: 2025-11-29T04:34:27.158Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T04:34:27.158Z
Learning: All instructions, documentation, and operational guidance should be maintained in AGENTS.md as the single source of truth
Applied to files:
.agent/AGENTS.md
📚 Learning: 2025-12-22T01:24:53.937Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: templates/home/AGENTS.md:0-0
Timestamp: 2025-12-22T01:24:53.937Z
Learning: Follow all security protocols and working directory specifications defined in ~/Git/aidevops/AGENTS.md
Applied to files:
.agent/tools/opencode/opencode.md
📚 Learning: 2025-11-29T04:34:30.742Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-11-29T04:34:30.742Z
Learning: Reference AGENTS.md for authoritative AI assistant guidance instead of GEMINI.md
Applied to files:
.agent/tools/opencode/opencode.md
📚 Learning: 2026-01-06T15:57:56.007Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.007Z
Learning: Applies to **/setup.sh : Deploy agents locally using ./setup.sh script
Applied to files:
.agent/tools/opencode/opencode.md
🧬 Code graph analysis (1)
setup.sh (4)
.agent/scripts/version-manager.sh (2)
print_info(17-17)print_warning(19-19)aidevops.sh (2)
print_info(25-25)print_warning(27-27).agent/scripts/verify-mirrors.sh (2)
print_info(23-23)print_warning(25-25)templates/deploy-templates.sh (2)
print_info(16-16)print_warning(18-18)
🪛 Gitleaks (8.30.0)
.agent/tools/opencode/opencode-anthropic-auth.md
[high] 373-374: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (9)
.agent/AGENTS.md (1)
255-255: LGTM!Clean documentation update that properly expands the plugins context to reflect the new Anthropic OAuth plugin. The ordering maintains consistency with the plugin names.
.agent/tools/opencode/opencode.md (2)
44-48: LGTM!Good addition to the Quick Reference section - the authentication commands with clear comments for each OAuth provider make it easy for users to understand their options at a glance.
80-108: Well-structured documentation for the new Anthropic OAuth Plugin section.The documentation follows the established pattern with:
- Clear setup instructions
- Comparison table for authentication methods with cost implications
- Concise benefits list
- Cross-reference to detailed documentation
This aligns well with the progressive disclosure approach.
setup.sh (1)
1640-1687: Clean refactor of setup_opencode_plugins() to support multiple plugins.The function now:
- Uses the new
add_opencode_pluginhelper for both Antigravity and Anthropic plugins- Provides clear post-setup instructions for both OAuth options
- Maintains explicit
return 0This is a solid pattern for adding future OpenCode plugins.
.agent/tools/opencode/opencode-anthropic-auth.md (5)
370-377: Static analysis false positive - this is documentation, not credentials.Gitleaks flagged this as a "Generic API Key" but these are Anthropic beta feature flag identifiers (like
oauth-2025-04-20,interleaved-thinking-2025-05-14), not actual API keys or secrets. The example shows how to customize beta flags in a fork scenario.
1-42: Comprehensive Quick Reference section with clear authentication options.The documentation provides an excellent at-a-glance summary with:
- Purpose and repository link
- Authentication method comparison table with use cases
- Quick setup commands
This follows the progressive disclosure pattern established in other aidevops docs.
152-198: Clear OAuth flow documentation.The PKCE flow explanation is well-documented with the four-step process (Authorization Request → Token Exchange → API Usage → Token Refresh). The details about beta feature injection and tool name prefixing provide good insight into the plugin's behavior.
331-352: Strong security considerations section.Good coverage of:
- OAuth security (PKCE, local token storage, automatic rotation)
- API key security best practices
- Clear guidance on when to use OAuth vs manual keys (CI/CD)
This maintains the zero-technical-debt quality standard.
396-427: Integration notes align well with aidevops ecosystem.The documentation correctly explains:
- Automatic setup via
setup.sh- Recommended configuration for different agent types
- Credential storage locations
This ties the plugin cleanly into the existing framework.
🤖 Augment PR SummarySummary: Adds support for the Changes:
Technical Notes: Plugin entries are maintained idempotently in 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| - **Purpose**: OAuth authentication for Claude Pro/Max accounts in OpenCode | ||
| - **Repository**: https://github.com/anomalyco/opencode-anthropic-auth | ||
| - **Installation**: `npm install -g opencode-anthropic-auth` (auto-installed by setup.sh) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpenCode installs npm plugins listed in ~/.config/opencode/opencode.json automatically at startup (via Bun), so requiring npm install -g opencode-anthropic-auth / calling it “globally installed” may be misleading for users. Consider documenting it as “added to the plugin array; OpenCode will auto-install on next run” (also applies to the other npm-install mentions below).
🤖 Was this useful? React with 👍 or 👎



Summary
Adds support for the
opencode-anthropic-authplugin, enabling OAuth authentication for Claude Pro/Max accounts in OpenCode.Changes
Documentation Created
.agent/tools/opencode/opencode-anthropic-auth.md- Comprehensive guide covering:Documentation Updated
.agent/tools/opencode/opencode.mdCode Changes
setup.shsetup_opencode_plugins()to support multiple pluginsadd_opencode_plugin()helper function (DRY principle)opencode-anthropic-auth@latestplugin.agent/AGENTS.mdFeatures
The Anthropic OAuth plugin provides:
Testing
✅ All tests passed:
./setup.shsuccessfully without errorsopencode-anthropic-auth@latestadded to~/.config/opencode/opencode.json~/.aidevops/agents/tools/opencode/Usage
After running
./setup.sh, users can authenticate with:Then choose:
Benefits for Users
References
Files Changed
Summary by CodeRabbit
Release Notes
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.