Repolode
CopilotC-Nvim

CopilotC-Nvim/CopilotChat.nvim

A Neovim plugin that brings GitHub Copilot Chat into the editor, with buffer, file, git diff and URL context plus optional tool calling.

Open-source alternative to:GitHub Copilot Chat

Stars
3,648
Forks
173
Open issues
24
Last commit
16 days ago

What is it?

CopilotChat.nvim is a Lua plugin for Neovim that opens a chat window where you can talk to GitHub Copilot models without leaving the editor. You reference context with a few inline markers: #buffer for open buffers, #file for a specific path, #gitdiff for staged or unstaged changes, #url for web pages, and #selection for the current visual selection. Predefined prompts such as Explain, Review, Fix, Tests and Commit cover common code tasks, and you can define your own prompts and functions in the setup config.

The chat supports tool calling through @copilot, which lets the model run functions like file reads, glob, grep, git diff and bash. Tool calls require manual approval by default, and you can mark specific tools or groups as trusted. Besides the Copilot provider, it can be configured with custom providers such as Ollama and Mistral.ai, and it offers a Lua API for scripting and headless use.

Key features

  • 01Chat with GitHub Copilot models such as GPT-4o and Claude Sonnet from Neovim.
  • 02Add buffers, files, git diffs, URLs and selections to a prompt with #-references.
  • 03Let the model call workspace tools with manual approval or trusted auto-run.
  • 04Reusable prompt templates for explain, review, fix, tests and commit messages.
  • 05Save and load chat history, and add answers or diffs to the quickfix list.
  • 06Lua API for automation and headless operation.

Use cases

  • Asking Copilot to explain or review the code in the current buffer without switching tools.
  • Generating unit tests or doc comments for a selected function.
  • Drafting a commit message from staged git changes.
  • Using a local model such as Ollama inside the same chat workflow via a custom provider.

Quick start

  1. 1

    Install Neovim 0.10.0+ and enable Copilot Chat in your GitHub settings

  2. 2

    Add the plugin and its plenary.nvim dependency to your lazy.nvim config

  3. 3

    Open the chat window inside Neovim

    :CopilotChat

Things to know

  • Requires Copilot Chat to be enabled on your GitHub account.
  • Runs only inside Neovim.
  • Licensed under GPL-3.0, a copyleft license.

In collections

Topics

FAQ

What is CopilotChat.nvim?
A Neovim plugin that brings GitHub Copilot Chat into the editor, with buffer, file, git diff and URL context plus optional tool calling. CopilotChat.nvim is a Lua plugin for Neovim that opens a chat window where you can talk to GitHub Copilot models without leaving the editor. You reference context with a few inline markers: #buffer for open buffers, #file for a specific path, #gitdiff for staged or unstaged changes, #url for web pages, and #selection for the current visual selection. Predefined prompts such as Explain, Review, Fix, Tests and Commit cover common code tasks, and you can define your own prompts and functions in the setup config.
Is CopilotChat.nvim free to use? What license does it have?
CopilotChat.nvim is open source under the GPL-3.0 license. Check the license terms before using it in commercial products.
Is CopilotChat.nvim still maintained?
Actively maintained. The last commit to CopilotChat.nvim was on Oct 23, 2026.
What can I use CopilotChat.nvim for?
Asking Copilot to explain or review the code in the current buffer without switching tools. Generating unit tests or doc comments for a selected function. Drafting a commit message from staged git changes. Using a local model such as Ollama inside the same chat workflow via a custom provider.
How do I install CopilotChat.nvim?
Install Neovim 0.10.0+ and enable Copilot Chat in your GitHub settings Add the plugin and its plenary.nvim dependency to your lazy.nvim config Open the chat window inside Neovim: :CopilotChat
Where can I get CopilotChat.nvim?
The source code and installation instructions are on GitHub: https://github.com/CopilotC-Nvim/CopilotChat.nvim

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects