A dedicated Neovim plugin for the Goose AI agent, providing a seamless in-editor AI coding experience with context awareness, diff review, and multi-model backends.
Overview#
goose.nvim is a Neovim plugin that provides seamless integration with the Goose AI agent, enabling developers to code, debug, and automate with a powerful AI assistant directly within the editor without switching windows.
Problem Solved: Developers using AI coding assistants often need to switch between editors and browsers or standalone applications, disrupting workflow. Additionally, AI often lacks deep awareness of the current editor context (open files, diagnostic errors, selected code).
Capability Boundary: This plugin does not include the AI model itself; it must depend on the Goose CLI developed by Block and its configured LLM providers (e.g., OpenAI, Anthropic, Ollama).
Core Features#
| Category | Feature | Description |
|---|---|---|
| Editor Integration | Context Awareness | Automatically captures current file, selected text, and LSP diagnostics as prompt context |
| File Reference | Supports @ syntax to manually reference specific project files | |
| Diff View | Built-in diff view to compare AI changes with rollback support | |
| Interaction Modes | Auto Mode | Default mode with full Agent capabilities and tool calling |
| Chat Mode | Disables tool calling, text-only conversation for simple Q&A or code discussions | |
| Session Management | Persistent Sessions | Sessions bound to workspace, resumable after closing |
| UI/UX | Flexible Layout | Supports floating windows or split mode with left/right/center alignment |
Installation & Configuration#
Prerequisites:
- Install Goose CLI: Refer to the official Goose documentation
- Configure LLM provider: Run
goose configureto set API Key and model
lazy.nvim Installation:
{
"azorng/goose.nvim",
config = function()
require("goose").setup({})
end,
dependencies = {
"nvim-lua/plenary.nvim",
"MeanderingProgrammer/render-markdown.nvim",
},
}
Key Configuration Options:
require('goose').setup({
prefered_picker = nil, -- 'telescope', 'fzf', 'mini.pick', 'snacks'
default_global_keymaps = true,
keymap = {
global = {
toggle = '<leader>gg', -- Toggle Goose
open_input = '<leader>gi', -- Open input window
open_output = '<leader>go', -- Open output window
diff_open = '<leader>gd', -- Open diff view
},
window = {
submit = '<cr>', -- Submit prompt
mention_file = '@', -- Reference file
}
},
ui = {
window_type = "float", -- float|split
layout = "right", -- right|left|center
}
})
Vim Commands#
:Goose— Toggle main window:GooseRun <prompt>— Run prompt in current session:GooseRunNewSession <prompt>— Start new session and run prompt:GooseSelectSession— Select historical session:GooseDiff— Open diff view
Supported LLM Providers#
anthropic, azure, bedrock, databricks, google, groq, ollama, openai, openrouter
Use Cases#
- Code Development: Collaborate with AI to write, modify, and debug code within the editor
- Project Building: Use Goose's automation capabilities to build complete projects from scratch
- Code Review: Review AI-suggested changes through diff viewing
- Context-Aware Conversation: Intelligent dialogue based on current file and project context