opencode.nvim
Connect Neovim to OpenCode within your existing editor workflow.
- Source repo
- nickjvandyke/opencode.nvim
- Stars
- ★ 3.9k
- Last updated
- 1mo ago v1.0.2
- FARS reviewed
- Nov 07, 2026
- License
- MIT
- Primary language
- Lua
- FA score
- 62/100 · Some gaps
At a glance
- How it runs
- Works with
- Portable with changes
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- Neovim users who want to leverage OpenCode without leaving their editor.
- Not a fit if
- Developers who don't use Neovim; it's a Neovim-only plugin
- Users wanting zero config; OpenCode CLI and a server port are required
- Maintenance
- Commits in the last 6 monthslast commit 2026-10-30latest release v1.0.2 (2026-09-14)+0.6 ★/day over 7 days
- Source review
- 62/100 · Some gaps
What does this agent do, and when should you use it?
opencode.nvim is a Neovim plugin that integrates with OpenCode's TUI and server to bring AI pair programming into the standard Neovim interface. It enables injecting editor context (cursor, selection, buffers) into prompts, supports prompt input with completions and highlighting, selection from built-in or custom prompts, execution of OpenCode commands, accepting/rejecting/reloading edits, and handling OpenCode events as autocmds. The plugin can connect to any OpenCode server or start an integrated instance. It prioritizes focused pairing with a single OpenCode instance and provides simple, Vim-centric defaults. Setup is straightforward via vim.pack, lazy.nvim, or nixvim.
opencode.nvim exposes a Lua API via require("opencode"), including ask() for prompting, select() for choosing prompts/commands/servers, prompt() for sending prompts with context injection, operator() for operator-style usage, and command() for executing OpenCode commands like session.new or session.undo. It replaces context placeholders (@this, @buffer, @diagnostics) in prompts. When OpenCode edits a file, the plugin reloads the buffer and shows the diff using Neovim's :diffpatch for review. It also forwards Server-Sent Events as OpencodeEvent autocmds for custom handling. Server discovery and startup are controlled via vim.g.opencode_opts.server, defaulting to starting term://opencode --port. Permissions requests trigger interactive approval dialogs.
- Neovim users who want to leverage OpenCode without leaving their editor.
- Developing features that benefit from sending specific code regions or buffers as context for AI suggestions.
- Teams that want to standardize AI prompts (e.g., code review, testing) across their editor setup.
- Power users who need to automate or react to OpenCode session events, such as status updates or permission requests.
- Developers who prefer to review and accept AI-generated edits using familiar diff tools within Neovim.
How do you install or deploy this agent?
Recommended: use vim.pack by adding vim.pack.add({ { src = "https://github.com/nickjvandyke/opencode.nvim", version = vim.version.range("*") } }) and set vim.g.opencode_opts. Alternative: lazy.nvim with { "nickjvandyke/opencode.nvim", version = "*", config = function() ... end }, or nixvim with extraPlugins = [ pkgs.vimPlugins.opencode-nvim ];. After installation, run :checkhealth opencode.
How do you use this agent?
Ensure OpenCode CLI is installed and can be run (with --port flag). Configure vim.g.opencode_opts and define keymaps, for example: vim.keymap.set({ "n", "x" }, "<C-a>", function() require("opencode").ask("@this: ") end). Then use the keymaps to invoke ask/select/operator. The plugin will attempt to connect to a running OpenCode server, or start one via the server.start function. Optionally, set server.url to connect to a remote server.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
What are this agent's strengths and limitations?
- Deep integration with Neovim using native interfaces (diff, operators, autocmds).
- Preserves existing editor muscle memory and workflow, no new interaction model.
- Flexible server configuration: connect to any OpenCode server or auto-start one.
- Context injection and built-in prompt library accelerate common tasks (review, test, etc.).
- Event-driven architecture enables real-time updates and custom automations.
- Requires OpenCode CLI installed and configured to expose its server on a port.
- Designed primarily for single-instance use; switching between servers frequently may need
connectadjustments. - Written in Lua; users unfamiliar with Neovim plugin development may find customization challenging.
- Depends on OpenCode's API and event formats; version mismatches could break functionality.
- Limited documentation on extending the plugin beyond provided options; advanced use may require reading type definitions.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| opencode.nvim This agent | 62 · Some gaps | IDE extensionFree + model costs | ★ 3.9k | 1mo ago | Lua | — |
| Calyx | 72 · Some gaps | Desktop appFree | ★ 367 | 2d ago | Swift | Codex · Claude Code |
| Vibe Coding Chinese Guide | 38 · Major gaps | CLIFree | ★ 18k | 1mo ago | Makefile | Codex · Claude Code |
| NeuroSquad Terminal Dashboard | 80 · Good | CLIFree + model costs | ★ 30 | 1mo ago | TypeScript | Codex · Claude Code |
How does FollowAgents rate this agent?
Why each dimension lost points
The source describes connecting only to configured or discovered OpenCode servers and interacting through Neovim context, REST, and SSE. Permission requests prompt the user; edits are shown as diffs with accept, reject, and per-hunk actions, giving some least-privilege and recovery controls. The README warns that OpenCode reads referenced files from disk and that events are forwarded as-is, but the sample does not explain password protection, prompt-data handling, or dependency security review, so sensitive-data handling and dependency security are only partly supported. Publisher identity is unverified, and the code shown does not establish a clear attribution process, so source attribution is thin.
The README and AGENTS.md broadly agree on entrypoints, configuration, server discovery, context, and edit flow. CI configuration shows format checks and LuaLS diagnostics, and dependencies identify the required CLI and curl plus optional UI plugins. Deductions reflect the absence of a test framework or reproducible behavior tests, and limited failure guidance: a five-second auto-start polling timeout is mentioned, but concrete error messages and recovery diagnostics are not shown.
The product is clearly aimed at pairing OpenCode with Neovim and supports arbitrary server connections, auto-start, context placeholders, custom prompts, commands, and optional Snacks/Blink integrations. The docs describe v1/v2 choices, a server connection switch, and the possibility that event contracts change. Deductions reflect that scenarios mostly target users familiar with Neovim and Lua, with little detail on other environments or edge cases.
The README is organized around installation, configuration, usage, events, and permissions, with examples for vim.pack, lazy.nvim, Nixvim, and several integrations; AGENTS.md adds architecture and development guidance. The MIT license text is complete. The README notes that event shapes may change with OpenCode releases and explains the v1/v2 selection. Deductions reflect brief prerequisite and troubleshooting notes, no separate FAQ in the sample, no complete changelog shown, and no explicit maintenance-responsibility commitment; publisher identity is unknown.
The plugin sends editor context to OpenCode and provides prompts, commands, event handling, and reviewable edit diffs, supporting the stated in-editor pairing workflow. Deductions reflect reliance on an external OpenCode service and an existing Neovim workflow, with no execution evidence or user outcome data in the sample to establish realized benefit or cost.
The main feature claims can be cross-checked between the README and AGENTS.md descriptions of entrypoints, architecture, and CI configuration. The docs also distinguish pass-through event behavior and possible version changes as limitations. Deductions reflect that some specific behaviors are documented claims only; the sample contains no behavioral tests or run evidence, so actual results cannot be verified.
- The plugin sends editor context and prompts to an OpenCode server; confirm the server target and that selected context is appropriate to transmit.
- Edits are reflected in buffers in real time. Diff review and accept/reject controls are documented, but save important work and inspect changes.
- The sample has no behavioral tests and gives limited detail on protecting server passwords and prompt data.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
Release notes excerpt
[1.0.2](https://github.com/nickjvandyke/opencode.nvim/compare/v1.0.1...v1.0.2) (2026-09-14) Bug Fixes * windows: error when discovering servers ([#327](https://github.com/nickjvandyke/opencode.nvim/issues/327)) ([618c91a](https://github.com/nickjvandyke/opencode.nvim/commit/618c91ad5fe2fe3761108205c3d793a5aae0d76f))View on GitHub ↗ -
Release notes excerpt
[1.0.1](https://github.com/nickjvandyke/opencode.nvim/compare/v1.0.0...v1.0.1) (2026-09-11) Bug Fixes * edits: diff new files ([#324](https://github.com/nickjvandyke/opencode.nvim/issues/324)) ([df1a05f](https://github.com/nickjvandyke/opencode.nvim/commit/df1a05f5345ad072d6c91a020ae2a27f7c952e47))View on GitHub ↗ -
Release notes excerpt
[1.0.0](https://github.com/nickjvandyke/opencode.nvim/compare/v0.14.0...v1.0.0) (2026-08-20) This release signifies my confidence in the plugin's stability. Thanks to everyone who contributed along the way! I hope I've made your dev life easier. Features * health: simplify opencode version check to minimum version ([3f9e5f1](https://github.com/nickjvandyke/opencode.nvim/commit/3f9e5f13e7f45f0e759300c8a2b517df20442268)) Miscellaneous Chores * trigger 1.0.0 release ([d3a7eec](https://github.com/nickjvandyke/opencode.nvim/commit/d3a7eece9278657bf8f3205397bf441a49ed4cf9))View on GitHub ↗
FAQ
How do I connect to a remote OpenCode server?
vim.g.opencode_opts.server.url to the server's URL (e.g., http://localhost:PORT or a remote address). The plugin will connect to that server instead of starting a new one.How are edit permissions handled?
:diffpatch to show changes. You can press da to accept all, dr to reject all, or dp/do to accept/reject the hunk under the cursor.Which context placeholders are available?
@this (range/selection or cursor position), @buffer (current buffer), @buffers (all open buffers), @diagnostics, @marks, @quickfix, and @visible.Can I customize the built-in prompts?
lua/opencode/config.lua.Does it support multiple OpenCode instances simultaneously?
vim.g.opencode_opts.server.connect to avoid disruptive synchronous events.Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.