An open API service indexing awesome lists of open source software.

https://github.com/azorng/goose.nvim

seamless neovim integration with goose - work with a powerful AI agent without leaving your editor
https://github.com/azorng/goose.nvim

agent ai cursor goose nvim nvim-plugin plugin

Last synced: 2 months ago
JSON representation

seamless neovim integration with goose - work with a powerful AI agent without leaving your editor

Awesome Lists containing this project

README

        

# 🪿 goose.nvim

> seamless neovim integration with goose - work with a powerful AI agent without leaving your editor

![Neovim](https://img.shields.io/badge/NeoVim-%2357A143.svg?&style=for-the-badge&logo=neovim&logoColor=white)
[![GitHub stars](https://img.shields.io/github/stars/azorng/goose.nvim?style=for-the-badge)](https://github.com/azorng/goose.nvim/stargazers)
![Last Commit](https://img.shields.io/github/last-commit/azorng/goose.nvim?style=for-the-badge)

## ✨ Description

This plugin provides a bridge between neovim and the [goose](https://github.com/block/goose) AI agent, creating a chat interface while capturing editor context (current file, selections) to enhance your prompts. It maintains persistent sessions tied to your workspace, allowing for continuous conversations with the AI assistant similar to what tools like Cursor AI offer.


Goose.nvim interface

## 📑 Table of Contents

- [Requirements](#-requirements)
- [Compatibility](#-compatibility)
- [Installation](#-installation)
- [Configuration](#️-configuration)
- [Usage](#-usage)
- [Setting Up Goose CLI](#-setting-up-goose-cli)

## 📋 Requirements

- Goose CLI installed and available (see [Setting Up Goose CLI](#-setting-up-goose-cli) below)

## ⚡ Compatibility

This plugin is compatible with Goose CLI version **`1.0.17`**.
Future versions may work but are not guaranteed. If you encounter issues with newer Goose CLI versions, please report them in the issues section.

## 🚀 Installation

Install the plugin with your favorite package manager. See the [Configuration](#-configuration) section below for customization options.

### With lazy.nvim

```lua
{
'azorng/goose.nvim',
branch = 'main',
config = function()
require('goose').setup({})
end,
dependencies = {
"nvim-lua/plenary.nvim",
{
"MeanderingProgrammer/render-markdown.nvim",
opts = {
anti_conceal = { enabled = false },
},
}
},
}
```

## ⚙️ Configuration

```lua
-- Default configuration with all available options
require('goose').setup({
keymap = {
global = {
open_input = 'gi', -- Opens and focuses on input window. Loads current buffer context
open_input_new_session = 'gI', -- Opens and focuses on input window. Loads current buffer context. Creates a new session
open_output = 'go', -- Opens and focuses on output window. Loads current buffer context
close = 'gq', -- Close UI windows
toggle_fullscreen = 'gf', -- Toggle between normal and fullscreen mode
select_session = 'gs', -- Select and load a goose session
},
window = {
submit = '', -- Submit prompt
close = '', -- Close UI windows
stop = '', -- Stop a running job
next_message = ']]', -- Navigate to next message in the conversation
prev_message = '[[', -- Navigate to previous message in the conversation
}
},
ui = {
window_width = 0.35, -- Width as percentage of editor width
input_height = 0.15, -- Input height as percentage of window height
fullscreen = false -- Start in fullscreen mode (default: false)
}
})
```

## 🧰 Usage

### Available Actions

The plugin provides the following actions that can be triggered via keymaps, commands, or the Lua API:

> **Note:** Buffer context is only set by calling the open actions

| Action | Default keymap | Command | API Function |
|-------------|--------|---------|---------|
| Open input window (current session) | `gi` | `:GooseOpenInput` | `require('goose.api').open_input()` |
| Open input window (new session) | `gI` | `:GooseOpenInputNewSession` | `require('goose.api').open_input_new_session()` |
| Open output window | `go` | `:GooseOpenOutput` | `require('goose.api').open_output()` |
| Close UI windows | `gq` | `:GooseClose` | `require('goose.api').close()` |
| Stop running job | `` (in window) | `:GooseStop` | `require('goose.api').stop()` |
| Toggle fullscreen mode | `gf` | `:GooseToggleFullscreen` | `require('goose.api').toggle_fullscreen()` |
| Select and load session | `gs` | `:GooseSelectSession` | `require('goose.api').select_session()` |
| Run prompt (continue session) | - | `:GooseRun ` | `require('goose.api').run("prompt")` |
| Run prompt (new session) | - | `:GooseRunNewSession ` | `require('goose.api').run_new_session("prompt")` |
| Navigate to next message | `]]` | - | - |
| Navigate to previous message | `[[` | - | - |

## 🔧 Setting Up Goose CLI

If you're new to Goose CLI:

1. **What is Goose CLI?**
- Goose is an AI agent developed by Block (the company behind Square, Cash App...)
- It offers powerful AI assistance through a command-line interface

2. **Installation:**
- Visit [Install Goose](https://block.github.io/goose/docs/getting-started/installation/) for installation instructions
- Ensure the `goose` command is available after installation

3. **Configuration:**
- Run `goose configure` to set up your provider (**Claude 3.7 Sonnet is recommended**)