opencode.nvim  by NickvanDyke

Neovim integration for AI coding assistant

Created 3 months ago
729 stars

Top 47.4% on SourcePulse

GitHubView on GitHub
Project Summary

This plugin integrates the opencode AI assistant with Neovim, providing a seamless way for developers to interact with AI models directly within their editor. It targets Neovim users who want to leverage AI for code generation, refinement, and contextual queries without leaving their workflow.

How It Works

The plugin connects to an opencode process, likely running as a separate TUI application. It intercepts user prompts, injects customizable editor context (like current buffer content, selections, or git diffs) into these prompts, and sends them to opencode. The responses are then displayed within Neovim, often in an embedded terminal or via notifications. This approach allows for flexible prompt engineering and context-aware AI assistance.

Quick Start & Requirements

  • Install via lazy.nvim or nixvim.
  • Requires snacks.nvim as a dependency.
  • Assumes an opencode process is running and accessible.
  • Official quick-start and configuration examples are provided in the README.

Highlighted Details

  • Supports auto-finding opencode processes within the current working directory or embedded terminals.
  • Offers customizable prompts and context injection using placeholders like @selection, @buffer, and @diff.
  • Provides integrated completion, highlighting, and normal-mode support for prompt refinement.
  • Forwards opencode Server-Sent-Events as Neovim autocmds for custom event handling.

Maintenance & Community

  • The project is maintained by NickvanDyke.
  • Inspired by nvim-aider and neopencode.nvim.

Licensing & Compatibility

  • The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is therefore unclear.

Limitations & Caveats

The plugin relies on opencode's "currently undocumented, likely unstable API," which poses a risk of breakage with opencode updates. It also requires a separate opencode process to be running, adding an external dependency to the setup.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
4
Issues (30d)
16
Star History
186 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
6 more.

prompt-engine by microsoft

0.1%
3k
NPM library for LLM prompt engineering
Created 3 years ago
Updated 2 years ago
Starred by Clement Delangue Clement Delangue(Cofounder of Hugging Face), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
10 more.

promptsource by bigscience-workshop

0.3%
3k
Toolkit for creating, sharing, and using natural language prompts
Created 4 years ago
Updated 2 years ago
Feedback? Help us improve.