https://github.com/olimorris/codecompanion.nvim
✨ AI Coding, Vim Style
https://github.com/olimorris/codecompanion.nvim
acp agent-client-protocol anthropic claude-code copilot copilot-chat deepseek gemini google-gemini llm neovim nvim ollama openai plugin vibe-coding
Last synced: 2 months ago
JSON representation
✨ AI Coding, Vim Style
- Host: GitHub
- URL: https://github.com/olimorris/codecompanion.nvim
- Owner: olimorris
- License: apache-2.0
- Created: 2023-12-27T17:32:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-20T21:04:38.000Z (3 months ago)
- Last Synced: 2026-01-21T06:42:02.502Z (3 months ago)
- Topics: acp, agent-client-protocol, anthropic, claude-code, copilot, copilot-chat, deepseek, gemini, google-gemini, llm, neovim, nvim, ollama, openai, plugin, vibe-coding
- Language: Lua
- Homepage: https://codecompanion.olimorris.dev
- Size: 7.73 MB
- Stars: 5,982
- Watchers: 26
- Forks: 358
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-vibe-coding - CodeCompanion.nvim - 用于AI辅助编程的Neovim插件,支持代理、斜杠命令和多种LLM。 (插件和扩展)
- awesome-AI-driven-development - codecompanion.nvim - AI-powered coding, seamlessly in Neovim (IDE Extensions / Neovim/Vim)
- awesome-kimi-cli - codecompanion.nvim - Neovim AI companion with kimi_cli adapter support. (Neovim Plugins)
- awesome-ChatGPT-repositories - codecompanion.nvim - ✨ A Copilot Chat experience in Neovim, complete with inline assistant. Supports Anthropic, Gemini, Ollama and OpenAI LLMs (Browser-extensions)
- StarryDivineSky - olimorris/codecompanion.nvim
- awesome-neovim-sorted - olimorris/codecompanion.nvim
- awesome-claude-code - codecompanion.nvim
- AiTreasureBox - olimorris/codecompanion.nvim - 11-03_5558_0](https://img.shields.io/github/stars/olimorris/codecompanion.nvim.svg)|✨ AI-powered coding, seamlessly in Neovim. Supports Anthropic, Copilot, Gemini, Ollama, OpenAI and xAI LLMs| (Repos)
- my-awesome-starred - olimorris/codecompanion.nvim - ✨ AI Coding, Vim Style (Lua)
- awesome-cli-agents - olimorris/codecompanion.nvim - ✨ AI Coding, Vim Style [Copilot] (5k⭐) (🚀 AI Tools for Vim, Neovim, and Terminal)
- awesome-ai-agents - olimorris/codecompanion.nvim - CodeCompanion.nvim integrates Neovim with various large language models (LLMs) and AI agents, enabling AI-powered coding, chat, inline transformations, and workflow automation. (Developer & Coding Assistants / IDE Integrations)
- awesome - olimorris/codecompanion.nvim - ✨ AI Coding, Vim Style (Lua)
- awesome-neovim - olimorris/codecompanion.nvim - Copilot Chat like experience, complete with inline assistant. Supports Anthropic, Gemini, Ollama and OpenAI. (AI / Diagnostics)
README
Code with LLMs and Agents via the in-built adapters, the community adapters or by building your own
New features are always announced here
## :purple_heart: Sponsors
Thank you to the following people:
If you love CodeCompanion and use it in your workflow, please consider sponsoring me
## :sparkles: Features
- :speech_balloon: [Copilot Chat](https://github.com/features/copilot) meets [Zed AI](https://zed.dev/blog/zed-ai), in Neovim
- :electric_plug: Support for LLMs from Anthropic, Copilot, GitHub Models, DeepSeek, Gemini, Mistral AI, Novita, Ollama, OpenAI, Azure OpenAI, HuggingFace and xAI (or [bring your own](https://codecompanion.olimorris.dev/extending/adapters.html))
- :robot: Support for [Agent Client Protocol](https://agentclientprotocol.com/overview/introduction), enabling coding with agents like [Augment Code](https://docs.augmentcode.com/cli/overview), [Cagent](https://github.com/docker/cagent) from Docker, [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview), [Codex](https://openai.com/codex), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [Goose](https://block.github.io/goose/), [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) and [OpenCode](https://opencode.ai)
- :heart_hands: User contributed and supported [adapters](https://codecompanion.olimorris.dev/configuration/adapters#community-adapters)
- :rocket: [Inline transformations](https://codecompanion.olimorris.dev/usage/inline-assistant.html), code creation and refactoring
- :art: [Variables](https://codecompanion.olimorris.dev/usage/chat-buffer/variables.html), [Slash Commands](https://codecompanion.olimorris.dev/usage/chat-buffer/slash-commands.html), [Tools](https://codecompanion.olimorris.dev/usage/chat-buffer/tools.html) and [Workflows](https://codecompanion.olimorris.dev/usage/workflows.html) to improve LLM output
- :brain: Support for [rules](https://codecompanion.olimorris.dev/usage/chat-buffer/rules.html) files like `CLAUDE.md`, `.cursor/rules` and your own custom ones
- :crystal_ball: Native [Super Diff](https://codecompanion.olimorris.dev/usage/chat-buffer/index.html#super-diff) for tracking agent edits
- :sparkles: Built-in [prompt library](https://codecompanion.olimorris.dev/usage/action-palette.html) for common tasks like advice on LSP errors and code explanations
- :building_construction: Create your own [custom prompts](https://codecompanion.olimorris.dev/configuration/prompt-library.html#creating-prompts), Variables and Slash Commands
- :books: Have [multiple chats](https://codecompanion.olimorris.dev/usage/introduction.html#quickly-accessing-a-chat-buffer) open at the same time
- :art: Support for [vision and images](https://codecompanion.olimorris.dev/usage/chat-buffer/#images-vision) as input
- :muscle: Async execution for fast performance
## :camera_flash: In Action
## :rocket: Getting Started
Everything you need to know about CodeCompanion (installation, configuration and usage) is within the [docs](https://codecompanion.olimorris.dev).
## :toolbox: Troubleshooting
Before raising an [issue](https://github.com/olimorris/codecompanion.nvim/issues), there are a number of steps you can take to troubleshoot a problem:
**Checkhealth**
Run `:checkhealth codecompanion` and check all dependencies are installed correctly. Also take note of the log file path.
**Turn on logging**
Update your config and turn debug logging on:
```lua
-- lazy.nvim
{
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
opts = {
-- NOTE: The log_level is in `opts.opts`
opts = {
log_level = "DEBUG", -- or "TRACE"
},
},
},
-- Other package managers
require("codecompanion").setup({
opts = {
log_level = "DEBUG", -- or "TRACE"
}
})
```
and inspect the log file as per the location from the checkhealth command.
**Try with a `minimal.lua` file**
A large proportion of issues which are raised in Neovim plugins are to do with a user's own config. That's why I always ask users to fill in a `minimal.lua` file when they raise an issue. We can rule out their config being an issue and it allows me to recreate the problem.
For this purpose, I have included a [minimal.lua](https://github.com/olimorris/codecompanion.nvim/blob/main/minimal.lua) file in the repository for you to test out if you're facing issues. Simply copy the file, edit it and run neovim with `nvim --clean -u minimal.lua`.
## :gift: Contributing
I am open to contributions but they will be implemented at my discretion. Feel free to open up a discussion before embarking on a PR and please read the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
## :clap: Acknowledgements
- [Steven Arcangeli](https://github.com/stevearc) for his genius creation of the chat buffer and his feedback early on
- [Wtf.nvim](https://github.com/piersolenski/wtf.nvim) for the LSP assistant action
- [CopilotChat.nvim](https://github.com/CopilotC-Nvim/CopilotChat.nvim) for the rendering and usability of the chat
buffer
- [Aerial.nvim](https://github.com/stevearc/aerial.nvim) for the Tree-sitter parsing which inspired the symbols Slash
Command
- [Saghen](https://github.com/Saghen) for the fantastic docs inspiration from [blink.cmp](https://github.com/Saghen/blink.cmp) and continued PRs to the project
- [Catwell](https://github.com/catwell) for the [queue](https://github.com/catwell/cw-lua/blob/master/deque/deque.lua) inspiration that I use to stack agents and tools
- [bassamsdata](https://github.com/bassamsdata) for the Super Diff, amazing `insert_edit_into_file` tool (the list is endless) and ongoing contributions to this project
- [ravitemer](https://github.com/ravitemer) for the fantastic extensions API
- [Davidyz](https://github.com/Davidyz) for his continued, excellent contributions that keep CodeCompanion going
- [Conrad Irwin](https://github.com/conradirwin), [Agus Zubiaga](https://github.com/agu-z) and Morgan Krey from [Zed Industries](https://github.com/zed-industries) for their support in implementing [ACP](https://agentclientprotocol.com)










