feat: add OpenCode compatibility support - #121
Open
ricky-theseus wants to merge 2 commits into
Open
Conversation
- env var fallback: OPENCODE_PLUGIN_ROOT -> CLAUDE_PLUGIN_ROOT, OPENCODE_PROJECT_DIR -> CLAUDE_PROJECT_DIR - project_locator.py: detect OpenCode env vars, fall back to ~/.opencode/ - runtime_compat.py: document OpenCode compat strategy - session_start.py: read OPENCODE_PLUGIN_ROOT, export CLAUDE_PLUGIN_ROOT - 8 SKILL.md: pre-set CLAUDE_* from OPENCODE_* before any reference - README: add OpenCode compatibility badge + installation guide All changes are non-breaking for existing Claude Code users.
ricky-theseus
marked this pull request as ready for review
June 20, 2026 01:59
Owner
|
感谢你的pr,关于opencode的适配在新的v7版本会使用另外一种方式来适配 |
Author
|
谢谢!这也是我第一次发PR,你的这个项目做得真的很好,我在它的基础上改了好多,现在批量生产网文非常丝滑
Original:
From:聆风< ***@***.***>Date:2026-06-22 15:27:50To:lingfengQAQ/webnovel-writer< ***@***.***>Cc:ricky-theseus< ***@***.***>、Author< ***@***.***>Subject:Re: [lingfengQAQ/webnovel-writer] feat: add OpenCode compatibility support (PR #121)lingfengQAQ left a comment (lingfengQAQ/webnovel-writer#121)
感谢你的pr,关于opencode的适配在新的v7版本会使用另外一种方式来适配
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add compatibility with OpenCode, an alternative to Claude Code. Makes the plugin work under OpenCode with zero breaking changes for existing Claude Code users.
Changes
Environment Variable Fallback Pattern
OpenCode does not set
CLAUDE_*env vars. Instead it usesOPENCODE_PLUGIN_ROOTandOPENCODE_PROJECT_DIR. A fallback chain was added:OPENCODE_PROJECT_DIR, fall back to~/.opencode/OPENCODE_PLUGIN_ROOT, export asCLAUDE_PLUGIN_ROOTCLAUDE_*fromOPENCODE_*before any existing referenceDocumentation
Testing
preflightcommand withOPENCODE_PLUGIN_ROOTset