opencode.nvim

Connect Neovim to OpenCode within your existing editor workflow.

Stars
★ 3.9k
Last updated
1mo ago v1.0.2
FARS reviewed
Nov 07, 2026
License
MIT
Primary language
Lua

At a glance

How it runs
IDE extension
Works with
Portable with changes
Cost
Free software; you pay for model usage
Setup effort
Medium · a few setup steps
You'll need
NeovimOpenCode CLIShell / CLINetwork accessLocal filesystem
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.

  1. Neovim users who want to leverage OpenCode without leaving their editor.
  2. Developing features that benefit from sending specific code regions or buffers as context for AI suggestions.
  3. Teams that want to standardize AI prompts (e.g., code review, testing) across their editor setup.
  4. Power users who need to automate or react to OpenCode session events, such as status updates or permission requests.
  5. 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)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

What are this agent's strengths and limitations?

Pros
  • 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.
Limitations
  • 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 connect adjustments.
  • 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?

FollowAgents source review · FARS-2.1
Some gaps
62/ 100 5-point scale 3.1 / 5
Trust 16/29
Reliability 8/14
Adaptability 12/18
Convention 12/18
Effectiveness 9/13
Verifiability 5/8
Why each dimension lost points
Trust16 / 29 · 2.8/5

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.

Reliability8 / 14 · 2.9/5

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.

Adaptability12 / 18 · 3.3/5

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.

Convention12 / 18 · 3.3/5

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.

Effectiveness9 / 13 · 3.5/5

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.

Verifiability5 / 8 · 3.1/5

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.

Risks and how to mitigate them
  • 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.
Evidence confidence: Low Reviewed Nov 07, 2026 Reviewed revision 4851ae503585
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/opencode-nvim.svg)](https://followagents.com/en/agents/opencode-nvim)
<a href="https://followagents.com/en/agents/opencode-nvim"><img src="https://followagents.com/badge/opencode-nvim.svg" alt="FARS review"></a>

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. v1.0.2
    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 ↗
  2. v1.0.1
    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 ↗
  3. v1.0.0
    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?
Set 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?
When OpenCode requests a permission, the plugin prompts you to approve or deny. For edits, it opens the target file in a new tab and uses :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?
The plugin supports @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?
Yes, you can override or add prompts in the configuration. The defaults include eight prompts (e.g., review, explain, test) and are defined in lua/opencode/config.lua.
Does it support multiple OpenCode instances simultaneously?
The plugin is designed for focused pairing with a single instance. If you often switch between servers, consider disabling vim.g.opencode_opts.server.connect to avoid disruptive synchronous events.
Was this page helpful?
View on GitHub ↗ Install ↓

Host ecosystems

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts