opencode.nvim  by sudo-tee

Neovim frontend for a terminal AI coding agent

Created 5 months ago
269 stars

Top 95.6% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This Neovim plugin provides a frontend for the opencode AI coding agent, enabling users to integrate powerful AI assistance directly within their editor. It addresses the need for context-aware AI interactions by capturing editor state—such as the current file, selections, and diagnostics—to enrich prompts. The plugin offers persistent chat sessions tied to workspaces, allowing for continuous AI-driven development and analysis, aiming to replicate the integrated experience of tools like Cursor AI for Neovim users.

How It Works

The opencode.nvim plugin acts as a bridge, facilitating communication between the Neovim editor and the opencode CLI agent. It captures relevant editor context automatically, including file content, cursor position, and diagnostics, and sends this information along with user prompts to the AI. The AI's responses are rendered within Neovim, often with support for markdown rendering. Key architectural choices include maintaining persistent, workspace-bound sessions for conversational continuity and offering extensive, customizable keymaps for seamless interaction with AI features like context management, session selection, and diffing.

Quick Start & Requirements

  • Installation: Install via a Neovim package manager (e.g., lazy.nvim example provided).
  • Prerequisites:
    • opencode CLI (v0.6.3 or newer) installed and available in the PATH.
    • nvim-lua/plenary.nvim and MeanderingProgrammer/render-markdown.nvim are required dependencies.
    • Optional dependencies for completion and pickers (e.g., nvim-cmp, telescope.nvim).
  • Setup: Requires configuring the opencode CLI and the Neovim plugin. Links to opencode installation and documentation are available.

Highlighted Details

  • Contextual Actions for Snapshots: An experimental feature that automatically creates snapshots of the workspace, enabling users to review, compare, and restore project states directly from the Neovim interface.
  • Integrated Agents: Supports distinct AI agents like 'Build' (for code generation/modification) and 'Plan' (for analysis without file changes), with extensibility for custom agents.
  • Rich Context Capture: Automatically includes current file content, selections, diagnostics, and cursor data in prompts, enhancing AI relevance.
  • Extensive Keymapping: Provides a highly configurable keymap system for managing sessions, navigating conversations, performing diff operations, and interacting with AI permissions.

Maintenance & Community

This plugin is a fork of the original goose.nvim by azorng. No specific details on current maintainers, sponsorships, or community channels (like Discord/Slack) are provided in the README.

Licensing & Compatibility

The repository README does not explicitly state a software license. This absence poses a significant adoption blocker, as it leaves the terms of use, modification, and distribution unclear, particularly for commercial or closed-source integration.

Limitations & Caveats

The plugin is explicitly stated to be in "early development" and is not recommended for production use due to potential bugs and breaking changes. The snapshot feature is also noted as experimental. Compatibility is contingent on using a compatible version of the opencode CLI.

Health Check
Last Commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
28
Issues (30d)
9
Star History
37 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.