> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/yetone/avante.nvim/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands

> Complete reference for all Avante.nvim commands

Avante.nvim provides a comprehensive set of commands for AI-powered code assistance. All commands are prefixed with `:Avante`.

## Core Commands

### AvanteAsk

Ask AI about your code and receive intelligent suggestions.

**Usage:**

```vim theme={null}
:AvanteAsk [question] [position=<position>] [project_root=<path>]
```

**Parameters:**

* `question` (optional) - The question to ask the AI
* `position` (optional) - Window position: `left`, `right`, `top`, `bottom`
* `project_root` (optional) - Override project root path

**Examples:**

```vim theme={null}
" Open sidebar in ask mode
:AvanteAsk

" Ask a specific question
:AvanteAsk How can I optimize this function?

" Ask with custom position
:AvanteAsk position=left Refactor this code

" Ask with custom project root
:AvanteAsk project_root=/path/to/project Explain this implementation
```

**Completion:**
The command provides auto-completion for:

* `position=left|right|top|bottom`
* `project_root=<available_project_roots>`

**Source:** plugin/avante.lua:70-90

***

### AvanteChat

Start a chat session with AI about your codebase. Similar to `AvanteAsk` but with `ask=false` by default.

**Usage:**

```vim theme={null}
:AvanteChat [position=<position>] [project_root=<path>]
```

**Parameters:**

* Same parameters as `AvanteAsk`
* Defaults to chat mode (`ask=false`)

**Examples:**

```vim theme={null}
" Start a chat session
:AvanteChat

" Chat with custom window position
:AvanteChat position=right
```

**Source:** plugin/avante.lua:91-100

***

### AvanteChatNew

Create a new chat session. The current chat can be re-opened with the chat session selector.

**Usage:**

```vim theme={null}
:AvanteChatNew
```

**Examples:**

```vim theme={null}
" Start a fresh chat session
:AvanteChatNew
```

**Source:** plugin/avante.lua:101-106

***

### AvanteToggle

Toggle the Avante AI panel visibility.

**Usage:**

```vim theme={null}
:AvanteToggle
```

**Examples:**

```vim theme={null}
" Toggle sidebar visibility
:AvanteToggle
```

**Source:** plugin/avante.lua:107

***

### AvanteBuild

Build dependencies for Avante.nvim.

**Usage:**

```vim theme={null}
:AvanteBuild [source=<true|false>]
```

**Parameters:**

* `source` (optional) - Build from source (default: `false`)

**Examples:**

```vim theme={null}
" Build using pre-built binaries
:AvanteBuild

" Build from source (requires cargo)
:AvanteBuild source=true
```

**Completion:**

* `source=true`
* `source=false`

**Source:** plugin/avante.lua:108-118

***

### AvanteEdit

Edit the selected code block with AI assistance.

**Usage:**

```vim theme={null}
:[range]AvanteEdit [instruction]
```

**Parameters:**

* `range` - Visual selection range (line1-line2)
* `instruction` (optional) - Editing instruction for the AI

**Examples:**

```vim theme={null}
" Edit visual selection with prompt
:'<,'>AvanteEdit Add error handling

" Edit with multi-word instruction
:'<,'>AvanteEdit Refactor to use async/await
```

**Source:** plugin/avante.lua:119-123

***

### AvanteRefresh

Refresh all Avante windows to sync with the current buffer.

**Usage:**

```vim theme={null}
:AvanteRefresh
```

**Examples:**

```vim theme={null}
" Refresh windows
:AvanteRefresh
```

**Source:** plugin/avante.lua:124

***

### AvanteFocus

Switch focus between the sidebar and code window.

**Usage:**

```vim theme={null}
:AvanteFocus
```

**Examples:**

```vim theme={null}
" Toggle focus between windows
:AvanteFocus
```

**Source:** plugin/avante.lua:125

***

### AvanteSwitchProvider

Switch the AI provider (e.g., Claude, OpenAI, Gemini).

**Usage:**

```vim theme={null}
:AvanteSwitchProvider
```

**Description:**
Opens an interactive selector to choose from available providers.

**Examples:**

```vim theme={null}
" Open provider selector
:AvanteSwitchProvider
```

**Source:** plugin/avante.lua:126-135

***

### AvanteSwitchSelectorProvider

Switch the selector provider (e.g., telescope, fzf\_lua, mini\_pick, snacks).

**Usage:**

```vim theme={null}
:AvanteSwitchSelectorProvider <provider>
```

**Parameters:**

* `provider` (required) - Name of the selector provider

**Examples:**

```vim theme={null}
" Switch to telescope
:AvanteSwitchSelectorProvider telescope

" Switch to fzf_lua
:AvanteSwitchSelectorProvider fzf_lua
```

**Source:** plugin/avante.lua:136-143

***

### AvanteSwitchInputProvider

Switch the input provider for user prompts.

**Usage:**

```vim theme={null}
:AvanteSwitchInputProvider <provider>
```

**Parameters:**

* `provider` (required) - `native`, `dressing`, or `snacks`

**Completion:**

* `native`
* `dressing`
* `snacks`

**Examples:**

```vim theme={null}
" Switch to native input
:AvanteSwitchInputProvider native

" Switch to snacks for modern UI
:AvanteSwitchInputProvider snacks
```

**Source:** plugin/avante.lua:144-152

***

### AvanteClear

Clear chat history or cache.

**Usage:**

```vim theme={null}
:AvanteClear [history|cache]
```

**Parameters:**

* `history` (default) - Clear current chat history
* `cache` - Clear all cached data (requires confirmation)

**Completion:**

* `history`
* `cache`

**Examples:**

```vim theme={null}
" Clear current chat history
:AvanteClear
:AvanteClear history

" Clear all cache (prompts for confirmation)
:AvanteClear cache
```

**Source:** plugin/avante.lua:153-176

***

### AvanteShowRepoMap

Display the repository map showing project structure.

**Usage:**

```vim theme={null}
:AvanteShowRepoMap
```

**Examples:**

```vim theme={null}
" Show repository structure
:AvanteShowRepoMap
```

**Source:** plugin/avante.lua:177

***

### AvanteModels

Open the model selector to view and switch between available models.

**Usage:**

```vim theme={null}
:AvanteModels
```

**Examples:**

```vim theme={null}
" Show available models
:AvanteModels
```

**Source:** plugin/avante.lua:178

***

### AvanteHistory

Open the history selector to browse and restore previous chat sessions.

**Usage:**

```vim theme={null}
:AvanteHistory
```

**Examples:**

```vim theme={null}
" Browse chat history
:AvanteHistory
```

**Source:** plugin/avante.lua:179

***

### AvanteStop

Stop the current AI request/generation.

**Usage:**

```vim theme={null}
:AvanteStop
```

**Examples:**

```vim theme={null}
" Cancel ongoing AI request
:AvanteStop
```

**Source:** plugin/avante.lua:180

***

## Summary Table

| Command                        | Description         | Range Support |
| ------------------------------ | ------------------- | ------------- |
| `AvanteAsk`                    | Ask AI about code   | No            |
| `AvanteChat`                   | Start chat session  | No            |
| `AvanteChatNew`                | Create new chat     | No            |
| `AvanteToggle`                 | Toggle sidebar      | No            |
| `AvanteBuild`                  | Build dependencies  | No            |
| `AvanteEdit`                   | Edit selected code  | Yes           |
| `AvanteRefresh`                | Refresh windows     | No            |
| `AvanteFocus`                  | Switch focus        | No            |
| `AvanteSwitchProvider`         | Switch AI provider  | No            |
| `AvanteSwitchSelectorProvider` | Switch selector     | No            |
| `AvanteSwitchInputProvider`    | Switch input UI     | No            |
| `AvanteClear`                  | Clear history/cache | No            |
| `AvanteShowRepoMap`            | Show repo structure | No            |
| `AvanteModels`                 | Show model selector | No            |
| `AvanteHistory`                | Browse chat history | No            |
| `AvanteStop`                   | Stop AI request     | No            |
