Add Opencode support as a new backend #20
Draft
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.
This PR adds support for Opencode, an open-source alternative to Claude Code, as a new backend for ai-code-interface.el.
What is Opencode?
Opencode is an open-source AI coding assistant that provides:
Changes
This PR follows the same pattern established by the GitHub Copilot CLI and Codex CLI integrations:
New file:
ai-code-opencode.elclaude-codeinfrastructure to run Opencodeopencode,opencode-switch-to-buffer,opencode-send-command, andopencode-resumeopencode-programfor configuring the executable pathUpdated:
ai-code-backends.elai-code-backendsconfiguration list~/.opencode/config.jsonUpdated:
ai-code-interface.el(require 'ai-code-opencode)to load the new moduleUpdated:
README.orgContext Features
The issue mentioned context command features like
@cursor,@buffer,@selection, and@visiblefrom opencode.nvim. These capabilities are already built into ai-code-interface.el and work automatically with the opencode backend:@buffer- Current buffer context@buffers- All buffers in current windowUsage
After installing the Opencode CLI:
M-x ai-code-select-backend→ select "ai-code-opencode.el"M-x opencodeor viaC-c amenuTesting
Fixes #[issue_number]
Original prompt
Fixes #9
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.