opencode.nvim

Connect Neovim to OpenCode within your existing editor workflow.

Stars
★ 3.9k
Last updated
6d ago
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

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.

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 51 · Major gaps IDE extensionFree + model costs ★ 3.9k 6d ago Lua —
Calyx 59 · Major gaps Desktop appFree ★ 348 4d ago Swift Codex · Claude Code
Vibe Coding Chinese Guide 38 · Major gaps CLIFree ★ 18k today Makefile Codex · Claude Code
NeuroSquad Terminal Dashboard 76 · Good CLIFree + model costs ★ 53 5d ago TypeScript Codex · Claude Code

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
51/ 100 5-point scale 2.6 / 5
This review covers the source as of Aug 12, 2026. The project has shipped 3 stable release(s) since, which have not been re-reviewed. The score and verdict describe the reviewed version only. Recent releases ↓
Trust 11/29
Reliability 6/14
Adaptability 12/18
Convention 10/18
Effectiveness 9/13
Verifiability 3/8
Why each dimension lost points
Trust11 / 29 · 1.9/5

Evidence shows the plugin asks user approval for permission requests (user_confirmation=2), but least privilege is not explicitly addressed (least_privilege=1). Data flow transparency is limited; no detailed explanation of what data is sent to OpenCode server (data_flow_transparency=1). Sensitive data handling not specified (sensitive_data_handling=1). Dependency security not assessed, relies on external tools (dependency_security=1). External effects limited but not detailed (external_effects=1). Rollback mechanism not specified (rollback=1). Source attribution via README and license, but publisher unverified (source_attribution=1).

Reliability6 / 14 · 2.1/5

Self-consistency is good; documentation and code examples align (self_consistency=2). Dependency availability not explicitly stated, relies on external OpenCode and Neovim (dependency_availability=1). Failure messages not detailed (failure_messages=1).

Adaptability12 / 18 · 3.3/5

Target audience clear (Neovim users), scenarios well-defined (audience_and_scenarios=2). Capability boundaries clear, e.g., single OpenCode instance (capability_boundaries=2). Trigger precision high via commands and keymaps (trigger_precision=2). Environment fit good with multiple installation methods (environment_fit=2).

Convention10 / 18 · 2.8/5

Information architecture clear, well-structured docs (information_architecture=2). Install notes detailed (install_notes=2). Naming stable, consistent API (naming_stability=2). Examples and FAQ sufficient (examples_and_faq=2). Known limitations mentioned but sparse (known_limitations=1). License clear MIT (license=2). Versioning and changelog not explicit (versioning_changelog=1). Maintenance responsibility not clear (maintenance_responsibility=1).

Effectiveness9 / 13 · 3.5/5

Output usability high with multiple interaction modes (output_usability=2). Marginal value clear, integrates existing tools (marginal_value=2). Cost-benefit reasonable, free and open source (cost_benefit=2).

Verifiability3 / 8 · 1.9/5

Claim traceability moderate; some features not detailed (claim_traceability=1). Cross-source corroboration limited, relies on single repo (cross_source_corroboration=1). Fact-inference separation not explicit (fact_inference_separation=1).

Risks and how to mitigate them
  • Publisher identity unverified; use with caution.
  • Permission handling details limited; review code for least privilege.
  • Data flow transparency insufficient; understand what data is sent to OpenCode server.
  • Relies on external OpenCode and Neovim; ensure environment compatibility.
Evidence confidence: Low Reviewed Aug 12, 2026 Reviewed revision 41622312d5d8 New commits since this review; the score may not cover them
See the full review method →

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.
View on GitHub ↗ Install ↓

Compare agents like this one

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

Related agents