### Install dressing.nvim Source: https://github.com/yetone/avante.nvim/blob/main/README.md Example of how to install dressing.nvim using lazy.nvim. ```lua { "stevearc/dressing.nvim" } ``` -------------------------------- ### Install Avante.nvim with mini.deps Source: https://github.com/yetone/avante.nvim/blob/main/README.md Setup Avante.nvim using mini.deps. This includes defining dependencies, optional plugins, and post-checkout hooks for building from source. Configuration for optional plugins and Avante.nvim itself is done using `later`. ```lua local add, later, now = MiniDeps.add, MiniDeps.later, MiniDeps.now add({ source = 'yetone/avante.nvim', monitor = 'main', depends = { 'nvim-lua/plenary.nvim', 'MunifTanjim/nui.nvim', 'echasnovski/mini.icons' }, hooks = { post_checkout = function() vim.cmd('make') end } }) --- optional add({ source = 'hrsh7th/nvim-cmp' }) add({ source = 'zbirenbaum/copilot.lua' }) add({ source = 'HakonHarnes/img-clip.nvim' }) add({ source = 'MeanderingProgrammer/render-markdown.nvim' }) later(function() require('render-markdown').setup({...}) end) later(function() require('img-clip').setup({...}) -- config img-clip require("copilot").setup({...}) -- setup copilot to your liking require("avante").setup({...}) -- config for avante.nvim end) ``` -------------------------------- ### Install snacks.nvim Source: https://github.com/yetone/avante.nvim/blob/main/README.md Example of how to install snacks.nvim using lazy.nvim. ```lua { "folke/snacks.nvim" } ``` -------------------------------- ### Configure Avante.nvim Setup Options Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configure Avante.nvim by passing options directly to the setup function. This example sets the provider to 'claude' and disables auto-suggestions. ```lua require("avante").setup({ provider = "claude", behaviour = { auto_suggestions = false, }, }) ``` -------------------------------- ### Install Avante.nvim with rocks.nvim Source: https://github.com/yetone/avante.nvim/blob/main/README.md Install Avante.nvim using rocks.nvim and set up the plugin in your init.lua. This method requires running `:Rocks install avante.nvim` first. ```lua require('avante').setup() ``` -------------------------------- ### Avante.nvim Setup with Full Configuration Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Main setup function for Avante.nvim. Configure providers, behavior, and window settings. ```lua require("avante").setup({ provider = "claude", mode = "agentic", instructions_file = "avante.md", providers = { claude = { endpoint = "https://api.anthropic.com", model = "claude-sonnet-4-20250514", timeout = 30000, extra_request_body = { temperature = 0.75, max_tokens = 20480, }, }, }, behaviour = { auto_suggestions = false, auto_set_highlight_group = true, auto_set_keymaps = true, auto_apply_diff_after_generation = false, support_paste_from_clipboard = false, minimize_diff = true, enable_token_counting = true, auto_add_current_file = true, auto_approve_tool_permissions = true, confirmation_ui_style = "inline_buttons", acp_follow_agent_locations = true, }, windows = { position = "right", wrap = true, width = 30, }, }) ``` -------------------------------- ### Install Avante.nvim with vim-plug Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configuration for vim-plug to install Avante.nvim and its dependencies. Includes optional dependencies and setup for autocompletion and UI enhancements. Use `do: 'make'` if building from source. ```vim call plug#begin() " Deps Plug 'nvim-lua/plenary.nvim' Plug 'MunifTanjim/nui.nvim' Plug 'MeanderingProgrammer/render-markdown.nvim' " Optional deps Plug 'hrsh7th/nvim-cmp' Plug 'nvim-tree/nvim-web-devicons' "or Plug 'echasnovski/mini.icons' Plug 'HakonHarnes/img-clip.nvim' Plug 'zbirenbaum/copilot.lua' Plug 'stevearc/dressing.nvim' " for enhanced input UI Plug 'folke/snacks.nvim' " for modern input UI " Yay, pass source=true if you want to build from source Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': 'make' } call plug#end() autocmd! User avante.nvim lua << EOF require('avante').setup({}) EOF ``` -------------------------------- ### Install Avante.nvim with lazy.nvim Source: https://github.com/yetone/avante.nvim/blob/main/README.md Recommended installation using lazy.nvim. Configure build options and dependencies. Ensure to set `version = false` and `build` appropriately for your system. ```lua { "yetone/avante.nvim", -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` -- ⚠️ must add this setting! ! ! build = vim.fn.has("win32") ~= 0 and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" or "make", event = "VeryLazy", version = false, -- Never set this value to "*"! Never! ---@module 'avante' ---@type avante.Config opts = { -- add any opts here -- this file can contain specific instructions for your project instructions_file = "avante.md", -- for example provider = "claude", providers = { claude = { endpoint = "https://api.anthropic.com", model = "claude-sonnet-4-20250514", timeout = 30000, -- Timeout in milliseconds extra_request_body = { temperature = 0.75, max_tokens = 20480, }, }, moonshot = { endpoint = "https://api.moonshot.ai/v1", model = "kimi-k2-0711-preview", timeout = 30000, -- Timeout in milliseconds extra_request_body = { temperature = 0.75, max_tokens = 32768, }, }, }, }, dependencies = { "nvim-lua/plenary.nvim", "MunifTanjim/nui.nvim", --- The below dependencies are optional, "nvim-mini/mini.pick", -- for file_selector provider mini.pick "nvim-telescope/telescope.nvim", -- for file_selector provider telescope "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions "ibhagwan/fzf-lua", -- for file_selector provider fzf "stevearc/dressing.nvim", -- for input provider dressing "folke/snacks.nvim", -- for input provider snacks "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons "zbirenbaum/copilot.lua", -- for providers='copilot' { -- support for image pasting "HakonHarnes/img-clip.nvim", event = "VeryLazy", opts = { -- recommended settings default = { embed_image_as_base64 = false, prompt_for_file_name = false, drag_and_drop = { insert_mode = true, }, -- required for Windows users use_absolute_path = true, }, }, }, { -- Make sure to set this up properly if you have lazy=true 'MeanderingProgrammer/render-markdown.nvim', opts = { file_types = { "markdown", "Avante" }, }, ft = { "markdown", "Avante" }, }, }, } ``` -------------------------------- ### Install Avante.nvim with Packer Source: https://github.com/yetone/avante.nvim/blob/main/README.md Install Avante.nvim and its dependencies using the Packer plugin manager. Ensure 'make' is run for the build process. ```vim -- Required plugins use 'nvim-lua/plenary.nvim' use 'MunifTanjim/nui.nvim' use 'MeanderingProgrammer/render-markdown.nvim' -- Optional dependencies use 'hrsh7th/nvim-cmp' use 'nvim-tree/nvim-web-devicons' -- or use 'echasnovski/mini.icons' use 'HakonHarnes/img-clip.nvim' use 'zbirenbaum/copilot.lua' use 'stevearc/dressing.nvim' -- for enhanced input UI use 'folke/snacks.nvim' -- for modern input UI -- Avante.nvim with build process use { 'yetone/avante.nvim', branch = 'main', run = 'make', config = function() require('avante').setup() end } ``` -------------------------------- ### Example avante.md Structure Source: https://github.com/yetone/avante.nvim/blob/main/README.md A comprehensive example of an avante.md file, demonstrating the structure for defining role, mission, project context, technology stack, and coding standards. ```markdown # project instructions for myapp ## your role you are an expert full-stack developer specializing in react, node.js, and typescript. you understand modern web development practices and have experience with our tech stack. ## your mission help build a scalable e-commerce platform by: - writing type-safe typescript code - following react best practices and hooks patterns - implementing restful apis with proper error handling - ensuring responsive design with tailwind css - writing comprehensive unit and integration tests ## project context myapp is a modern e-commerce platform targeting small businesses. we prioritize performance, accessibility, and user experience. ## technology stack - frontend: react 18, typescript, tailwind css, vite - backend: node.js, express, prisma, postgresql - testing: jest, react testing library, playwright - deployment: docker, aws ## coding standards - use functional components with hooks - prefer composition over inheritance - write self-documenting code with clear variable names - add jsdoc comments for complex functions - follow the existing folder structure and naming conventions ``` -------------------------------- ### Avante Tools - Custom Tool Example Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Example of how to define and add a custom tool to Avante. ```APIDOC ## Custom Tools Example Custom tools can be defined with a name, description, parameters, return values, and a Lua function to execute. ```lua require("avante").setup({ custom_tools = { { name = "run_go_tests", description = "Run Go unit tests and return results", param = { type = "table", fields = { { name = "target", description = "Package or directory to test", type = "string", optional = true, }, }, }, returns = { { name = "result", description = "Test output", type = "string", }, }, func = function(params) local target = params.target or "./..." return vim.system({ "go", "test", "-v", target }, { text = true }):wait().stdout end, }, }, }) ``` ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/yetone/avante.nvim/blob/main/CONTRIBUTING.md Set up pre-commit hooks for managing and maintaining code quality after cloning the repository. ```shell pre-commit install --install-hooks ``` -------------------------------- ### Configure Avante.nvim via Global Variables Source: https://github.com/yetone/avante.nvim/blob/main/README.md Alternatively, configure Avante.nvim by setting global variables in vim.g before calling setup. Options set in setup() will override these global values. ```lua vim.g.avante = { provider = "claude", behaviour = { auto_suggestions = false, }, } require("avante").setup() ``` -------------------------------- ### Setup Avante with Project and Global Rule Directories Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Configure Avante to load rule files from specified project and global directories. Project rules take precedence. ```lua require("avante").setup({ rules = { project_dir = ".avante/rules", global_dir = "~/.config/avante/rules", }, }) ``` -------------------------------- ### Setup Avante with Custom System Prompt Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Configure Avante to use a custom system prompt globally. This affects all LLM interactions. ```lua require("avante").setup({ system_prompt = "MY CUSTOM SYSTEM PROMPT", }) ``` -------------------------------- ### Configure Avante.nvim with Home Manager Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configure Avante.nvim within a Home Manager Nix configuration. This example shows how to specify the plugin and its Lua configuration. ```nix programs.neovim = { plugins = [ { plugin = pkgs.vimPlugins.avante-nvim; type = "lua"; config = '' require("avante").setup() ''; # or builtins.readFile ./plugins/avante.lua } ]; }; ``` -------------------------------- ### Setup Avante.nvim and Dependencies in Lua Source: https://github.com/yetone/avante.nvim/blob/main/README.md Set up Avante.nvim and other recommended plugins like nvim-cmp, img-clip, copilot, and render-markdown. This snippet demonstrates configuring Avante with 'snacks.nvim' as the input provider. ```lua -- deps: require('cmp').setup ({ -- use recommended settings from above }) require('img-clip').setup ({ -- use recommended settings from above }) require('copilot').setup ({ -- use recommended settings from above }) require('render-markdown').setup ({ -- use recommended settings from above }) require('avante').setup({ -- Example: Using snacks.nvim as input provider input = { provider = "snacks", -- "native" | "dressing" | "snacks" provider_opts = { -- Snacks input configuration title = "Avante Input", icon = " ", placeholder = "Enter your API key...", }, }, -- Your other config here! }) ``` -------------------------------- ### Configure Dressing.nvim Input Provider Source: https://github.com/yetone/avante.nvim/blob/main/README.md Utilize the 'dressing' input provider for enhanced UI. Ensure dressing.nvim is installed. ```lua input = { provider = "dressing", provider_opts = {}, } ``` -------------------------------- ### Avante Tools - Setup Configuration Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Configures the Avante tools, allowing for provider-specific settings, disabling tools, or adding custom tools. ```APIDOC ## require("avante").setup({options}) ### Description Configures the Avante tools with various options. ### Parameters #### Request Body - **options** (table) - Configuration options. Can include: - `providers` (table): Provider-specific settings, e.g., `{ claude = { disable_tools = true } }`. - `disabled_tools` (table): A list of tool names to disable, e.g., `{ "python" }`. - `custom_tools` (table): A list of custom tool definitions. ``` -------------------------------- ### avante-utils.has Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Checks if a specific plugin is installed. ```APIDOC ## M.has({plugin}) ### Description Checks if a plugin is installed. ### Parameters #### Path Parameters - **plugin** (string) - Required - The name of the plugin to check. ### Returns - (boolean) - True if the plugin is installed, false otherwise. ``` -------------------------------- ### Define Custom Tools Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Set up custom tools that can execute shell commands, scripts, or Lua functions. This example defines a tool to run Go unit tests. ```lua require("avante").setup({ custom_tools = { { name = "run_go_tests", description = "Run Go unit tests and return results", param = { type = "table", fields = { { name = "target", description = "Package or directory to test", type = "string", optional = true, }, }, }, returns = { { name = "result", description = "Test output", type = "string", }, }, func = function(params) local target = params.target or "./..." return vim.system({ "go", "test", "-v", target }, { text = true }):wait().stdout end, }, }, }) ``` -------------------------------- ### Enable Gemini CLI with ACP Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configure Avante.nvim to use the Gemini CLI as an ACP provider. Ensure the 'gemini' CLI tool is installed and GEMINI_API_KEY is set. ```lua { provider = "gemini-cli", -- other configuration options... } ``` -------------------------------- ### Get Cursor Rules Prompt Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Loads rules from the *.cursor/rules* directory for selected files. Returns nil if no rules are found. ```lua M.get_cursor_rules_prompt({selected_files}) -- Parameters: { -- selected_files: (AvanteSelectedFile[]) -- } -- Returns: (string|nil) ``` -------------------------------- ### Lazy.nvim Keymap Configuration for avante.nvim API Source: https://github.com/yetone/avante.nvim/wiki/Home Example settings for defining keymaps in `lazy.nvim` to interact with avante.nvim's public API functions like `ask`, `edit`, and `refresh`. Ensure `opts.mappings` are updated if custom keybindings are used. ```lua keys = function(_, keys) ---@type avante.Config local opts = require("lazy.core.plugin").values(require("lazy.core.config").spec.plugins["avante.nvim"], "opts", false) local mappings = { { opts.mappings.ask, function() require("avante.api").ask() end, desc = "avante: ask", mode = { "n", "v" }, }, { opts.mappings.refresh, function() require("avante.api").refresh() end, desc = "avante: refresh", mode = "v", }, { opts.mappings.edit, function() require("avante.api").edit() end, desc = "avante: edit", mode = { "n", "v" }, }, } mappings = vim.tbl_filter(function(m) return m[1] and #m[1] > 0 end, mappings) return vim.list_extend(mappings, keys) end, ``` -------------------------------- ### :AvanteChat Source: https://github.com/yetone/avante.nvim/blob/main/README.md Starts a chat session with AI about your codebase. The default is `ask`=false. ```APIDOC ## :AvanteChat ### Description Start a chat session with AI about your codebase. Default is `ask`=false. ### Method ``` :AvanteChat ``` ``` -------------------------------- ### Integrate Avante.nvim with NvimTree Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configure Avante.nvim to integrate with NvimTree, enabling file selection and deselection directly from the NvimTree interface. This setup requires defining keybindings for adding and removing files. ```lua { "yetone/avante.nvim", event = "VeryLazy", keys = { { "a+", function() local tree_ext = require("avante.extensions.nvim_tree") tree_ext.add_file() end, desc = "Select file in NvimTree", ft = "NvimTree", }, { "a-", function() local tree_ext = require("avante.extensions.nvim_tree") tree_ext.remove_file() end, desc = "Deselect file in NvimTree", ft = "NvimTree", }, }, opts = { --- other configurations selector = { exclude_auto_select = { "NvimTree" }, }, }, } ``` -------------------------------- ### Get ReAct System Prompt Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Retrieves the system prompt for the ReAct (Reasoning and Acting) agent. Requires provider configuration and options. ```lua M.get_ReAct_system_prompt({provider_conf}, {opts}) -- Parameters: { -- provider_conf: (AvanteDefaultBaseProvider) -- opts: (AvantePromptOptions) -- } -- Returns: (string) ``` -------------------------------- ### Get Agents Rules Prompt Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Fetches the content of agent-related markdown files, such as AGENTS.md or CLAUDE.md. Returns nil if no content is found. ```lua M.get_agents_rules_prompt() -- Returns: (string|nil) ``` -------------------------------- ### Configure Snacks.nvim Input Provider Source: https://github.com/yetone/avante.nvim/blob/main/README.md Use the 'snacks' input provider for a modern input UI. Additional options can be configured in 'provider_opts'. Ensure snacks.nvim is installed. ```lua input = { provider = "snacks", provider_opts = { title = "Avante Input", icon = " ", }, } ``` -------------------------------- ### Configure Avante RAG Service Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Configure the RAG service for Avante, which provides additional project context for AI responses. Ensure Docker or Nix is installed. After changing configuration, remove the old container using `docker rm -fv avante-rag-service`. ```lua require("avante").setup({ rag_service = { enabled = false, host_mount = os.getenv("HOME"), runner = "docker", llm = { provider = "openai", endpoint = "https://api.openai.com/v1", api_key = "OPENAI_API_KEY", model = "gpt-4o-mini", extra = nil, }, embed = { provider = "openai", endpoint = "https://api.openai.com/v1", api_key = "OPENAI_API_KEY", model = "text-embedding-3-large", extra = nil, }, docker_extra_args = "", }, }) ``` -------------------------------- ### Check if a Plugin is Installed Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Utility function to check if a specific plugin is installed in the Neovim environment. ```lua M.has({"plugin"}) -- Returns: (boolean) ``` -------------------------------- ### avante.setup Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Configures Avante with global settings such as system prompts or prompt directories. ```APIDOC ## require("avante").setup({opts}) ### Description Configures Avante with global settings. ### Parameters #### Request Body - **opts** (table) - Required - Configuration options. - **system_prompt** (string) - Optional - A custom system prompt. - **override_prompt_dir** (string) - Optional - Path to override the default prompt directory. - **rules** (table) - Optional - Configuration for rule directories. - **project_dir** (string) - Optional - Directory for project-specific rules. - **global_dir** (string) - Optional - Directory for global rules. ``` -------------------------------- ### Configure Project Instructions File Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Change the filename for project-specific instructions. Defaults to 'avante.md'. ```lua require("avante").setup({ instructions_file = "avante.md", }) ``` -------------------------------- ### M.get_cursor_pos Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Gets the current cursor position. ```APIDOC ## M.get_cursor_pos ### Description Gets the current cursor position. ### Returns - (integer, integer) - The row and column of the cursor. ``` -------------------------------- ### Migrate avante.nvim Configuration (Before) Source: https://github.com/yetone/avante.nvim/wiki/Provider-configuration-migration-guide Illustrates the previous structure of avante.nvim configuration, including built-in and custom providers, with request body parameters at the top level. ```lua { "yetone/avante.nvim", --- other configuration items ... opts = { --- other configuration items ... openai = { endpoint = "https://api.openai.com/v1", model = "gpt-4o", -- your desired model (or use gpt-4o, etc.) timeout = 30000, -- Timeout in milliseconds, increase this for reasoning models temperature = 0, max_completion_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models) reasoning_effort = "medium", -- low|medium|high, only used for reasoning models }, ollama = { endpoint = "http://127.0.0.1:11434", timeout = 30000, -- Timeout in milliseconds options = { temperature = 0.75, num_ctx = 20480, keep_alive = "5m", }, }, vendors = { groq = { __inherited_from = 'openai', api_key_name = 'GROQ_API_KEY', endpoint = 'https://api.groq.com/openai/v1/', model = 'llama-3.3-70b-versatile', temperature = 1, max_tokens = 32768, -- remember to increase this value, otherwise it will stop generating halfway disable_tools = true, }, }, }, --- other configuration items } ``` -------------------------------- ### M.icons_enabled Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Checks if an icon plugin is installed and enabled. ```APIDOC ## M.icons_enabled ### Description Check if an icon plugin is installed. ### Returns #### Success Response - **boolean** - True if an icon plugin is enabled, false otherwise. ``` -------------------------------- ### M.winline() Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Gets the current line number of the active window. ```APIDOC ## M.winline() ### Description Gets the current line number of the active window. ### Method N/A (Lua function) ### Parameters None. ### Returns - (integer) The current line number. ``` -------------------------------- ### Avante Tools - Git Diff Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Gets the Git diff. ```APIDOC ## M.git_diff() ### Description Gets the Git diff. ``` -------------------------------- ### Sidebar:setup_colors Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Sets up the color scheme for the sidebar. ```APIDOC ## Sidebar:setup_colors ### Description Sets up the color scheme for the sidebar. ### Method Call ### Endpoint Sidebar:setup_colors() ``` -------------------------------- ### Avante Tools - Get Tools Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Retrieves available tools based on user input and history. ```APIDOC ## M.get_tools({user_input}, {history_messages}) ### Description Retrieves available tools based on user input and history. ### Parameters #### Path Parameters - **user_input** (string) - The user's input. - **history_messages** (table) - The history of messages. ``` -------------------------------- ### Configure Avante Completion Sources in blink.cmp Source: https://github.com/yetone/avante.nvim/blob/main/README.md Integrate Avante.nvim's completion sources into blink.cmp by adding them to the 'default' list and configuring their providers. ```lua default = { ... "avante_commands", "avante_mentions", "avante_shortcuts", "avante_files", } ``` ```lua providers = { avante_commands = { name = "avante_commands", module = "blink.compat.source", score_offset = 90, -- show at a higher priority than lsp opts = {}, }, avante_files = { name = "avante_files", module = "blink.compat.source", score_offset = 100, -- show at a higher priority than lsp opts = {}, }, avante_mentions = { name = "avante_mentions", module = "blink.compat.source", score_offset = 1000, -- show at a higher priority than lsp opts = {}, }, avante_shortcuts = { name = "avante_shortcuts", module = "blink.compat.source", score_offset = 1000, -- show at a higher priority than lsp opts = {}, } ... } ``` -------------------------------- ### Enable Kimi CLI with ACP Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configure Avante.nvim to use Kimi CLI as an ACP provider. ```lua { provider = "kimi-cli", -- other configuration options... } ``` -------------------------------- ### :AvanteChatNew Source: https://github.com/yetone/avante.nvim/blob/main/README.md Starts a new chat session. The current chat can be re-opened with the chat session selector. ```APIDOC ## :AvanteChatNew ### Description Start a new chat session. The current chat can be re-opened with the chat session selector. ### Method ``` :AvanteChatNew ``` ``` -------------------------------- ### Sidebar:setup_window_navigation Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Configures keyboard shortcuts for focus switching within a sidebar component. ```APIDOC ## Sidebar:setup_window_navigation ### Description Sets up focus switching shortcuts for a specific sidebar component. ### Method (Not specified, likely a function call) ### Endpoint (Not applicable, Lua function) ### Parameters #### Path Parameters - **container** (NuiSplit) - The sidebar component for which to set up navigation. ``` -------------------------------- ### Avante RAG Service - Get Resources Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Retrieves a list of all available resources managed by the RAG service. ```APIDOC ## M.get_resources() ### Description Retrieves a list of all available resources. ### Returns - (AvanteRagServiceResourceListResponse|nil) - A list of resources or nil if an error occurred. ``` -------------------------------- ### Sidebar:initialize Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Initializes the sidebar instance, returning the instance itself. ```APIDOC ## Sidebar:initialize ### Description Initializes the sidebar instance. This is typically called once when the sidebar is first set up. ### Method (Not specified, likely a function call) ### Endpoint (Not applicable, Lua function) ### Returns - **avante.Sidebar** The initialized Sidebar instance. ``` -------------------------------- ### Sidebar:init_current_project Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Initializes settings related to the current project within the sidebar. ```APIDOC ## Sidebar:init_current_project ### Description Initializes or updates the sidebar's configuration and display based on the currently active Neovim project. ### Method (Not specified, likely a function call) ### Endpoint (Not applicable, Lua function) ### Parameters None ``` -------------------------------- ### Get Operating System Name Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Retrieves the name of the current operating system. Supported values are 'linux', 'darwin', or 'windows'. ```lua M.get_os_name() -- @return "linux" | "darwin" | "windows" ``` -------------------------------- ### avante-prompts.get_cursor_rules_prompt Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Loads rules from *.cursor/rules* directories based on selected files. ```APIDOC ## M.get_cursor_rules_prompt({selected_files}) ### Description Loads rules from *.cursor/rules* directories. ### Parameters #### Path Parameters - **selected_files** (AvanteSelectedFile[]) - Required - The list of selected files. ### Returns - (string|nil) - The loaded rules, or nil if none are found. ``` -------------------------------- ### Configure Qwen-coder Provider Source: https://github.com/yetone/avante.nvim/wiki/Custom-providers Configure the Qwen-coder provider from Alibaba Cloud's DashScope. This configuration inherits from OpenAI and requires the appropriate API key and endpoint. ```lua provider = "qianwen", providers = { qianwen = { __inherited_from = "openai", api_key_name = "DASHSCOPE_API_KEY", endpoint = "https://dashscope.aliyuncs.com/compatible-mode/v1", model = "qwen-coder-plus-latest", }, }, ``` -------------------------------- ### avante-utils.get_system_info Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Retrieves general system information. ```APIDOC ## M.get_system_info() ### Description Retrieves general system information. ### Returns - (any) - System information. ``` -------------------------------- ### Configure Mistral Provider Source: https://github.com/yetone/avante.nvim/wiki/Custom-providers Set up the Mistral AI provider, inheriting from OpenAI. This configuration includes an example of setting `extra_request_body` to manage `max_tokens`. ```lua provider = "mistral", providers = { mistral= { __inherited_from = "openai", api_key_name = "MISTRAL_API_KEY", endpoint = "https://api.mistral.ai/v1/", model = "mistral-large-latest", extra_request_body = { max_tokens = 4096, -- to avoid using max_completion_tokens }, }, }, ``` -------------------------------- ### Extract Request Body Contents with jq Source: https://github.com/yetone/avante.nvim/wiki/Help-me-to-debug Use this command to extract the 'contents' field from a JSON request body file. Ensure jq is installed. ```bash cat | jq -r ".contents" ``` -------------------------------- ### Extract Request Body Messages with jq Source: https://github.com/yetone/avante.nvim/wiki/Help-me-to-debug Use this command to extract the 'messages' field from a JSON request body file. Ensure jq is installed. ```bash cat | jq -r ".messages" ``` -------------------------------- ### Enable Avante.nvim in Nixvim Source: https://github.com/yetone/avante.nvim/blob/main/README.md Enable Avante.nvim and configure its settings within a Nixvim configuration. Use the 'settings' table for customization. ```nix plugins.avante.enable = true; plugins.avante.settings = { # setup options here }; ``` -------------------------------- ### Migrate avante.nvim Configuration (After) Source: https://github.com/yetone/avante.nvim/wiki/Provider-configuration-migration-guide Shows the updated avante.nvim configuration structure after migration, with providers consolidated under the 'providers' field and request body parameters moved to 'extra_request_body'. ```lua { "yetone/avante.nvim", --- other configuration items ... opts = { --- other configuration items ... providers = { openai = { endpoint = "https://api.openai.com/v1", model = "gpt-4o", -- your desired model (or use gpt-4o, etc.) timeout = 30000, -- Timeout in milliseconds, increase this for reasoning models extra_request_body = { temperature = 0, max_completion_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models) reasoning_effort = "medium", -- low|medium|high, only used for reasoning models }, }, ollama = { endpoint = "http://127.0.0.1:11434", timeout = 30000, -- Timeout in milliseconds extra_request_body = { options = { temperature = 0.75, num_ctx = 20480, keep_alive = "5m", }, }, }, groq = { __inherited_from = 'openai', api_key_name = 'GROQ_API_KEY', endpoint = 'https://api.groq.com/openai/v1/', model = 'llama-3.3-70b-versatile', disable_tools = true, extra_request_body = { temperature = 1, max_tokens = 32768, -- remember to increase this value, otherwise it will stop generating halfway }, }, }, }, --- other configuration items } ``` -------------------------------- ### Override Prompt Directory with Specific Path Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configure Avante.nvim to use custom prompt templates from a specified directory. This example sets the `override_prompt_dir` to a fixed path. ```lua require("avante").setup({ override_prompt_dir = vim.fn.expand("~/.config/nvim/avante_prompts"), }) ``` -------------------------------- ### Run Development Tooling Commands Source: https://github.com/yetone/avante.nvim/blob/main/CONTRIBUTING.md Execute linting, Lua type checking, and Lua testing commands using make. ```shell make lint make lua-typecheck make luatest ``` -------------------------------- ### Enable Claude Code with ACP Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configure Avante.nvim to use Claude Code as an ACP provider. Ensure the 'acp-claude-code' package is installed via npm and ANTHROPIC_API_KEY is set. ```lua { provider = "claude-code", -- other configuration options... } ``` -------------------------------- ### Configure Selector Provider (fzf-lua) Source: https://github.com/yetone/avante.nvim/blob/main/README.md Set the selector provider to 'fzf' (fzf-lua). Options can be overridden in 'provider_opts'. ```lua selector = { provider = "fzf", provider_opts = {}, } ``` -------------------------------- ### Configure Web Search Engine Provider Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Set up a web search engine provider like Tavily. Ensure the necessary API key environment variable is set for the chosen provider. ```lua require("avante").setup({ web_search_engine = { provider = "tavily", proxy = nil, }, }) ``` -------------------------------- ### M.get_win_options Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Retrieves window options. ```APIDOC ## M.get_win_options ### Description Retrieves window options. Specific parameters and return types are not detailed in the source. ``` -------------------------------- ### avante-rag-service.launch_rag_service Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Launches the RAG service. ```APIDOC ## avante-rag-service.launch_rag_service ### Description Launches the Retrieval-Augmented Generation (RAG) service. This service provides additional project context for AI responses. ### Method Lua Function Call ### Parameters - **cb** (fun()) - Optional - A callback function to be executed after the service is launched. ``` -------------------------------- ### Define AI Mission for Project Source: https://github.com/yetone/avante.nvim/blob/main/README.md Clearly outline the AI's primary objectives and how it should assist with development tasks. This guides the AI's focus and expected contributions. ```markdown ### your mission your primary goal is to help build and maintain [project description]. you should: - provide code suggestions that follow our established patterns and conventions - help debug issues by analyzing code and suggesting solutions - assist with refactoring to improve code quality and maintainability - suggest optimizations for performance and scalability - ensure all code follows our security guidelines - help write comprehensive tests for new features ``` -------------------------------- ### Pass Additional Generation Parameters for Gemini Source: https://github.com/yetone/avante.nvim/wiki/Home Customize generation parameters for the Gemini provider by adding accepted body fields to the `opts` configuration. This example shows how to set `stopSequences`. ```lua opts = { gemini = { -- see https://ai.google.dev/api/generate-content#request-body_1 generationConfig = { stopSequences = {"test"}, } } } ``` -------------------------------- ### Define Custom Shortcuts for Avante.nvim Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configure custom shortcuts with names, descriptions, details, and prompts. These are triggered by typing '#' followed by the shortcut name. ```lua { shortcuts = { { name = "refactor", description = "Refactor code with best practices", details = "Automatically refactor code to improve readability, maintainability, and follow best practices while preserving functionality", prompt = "Please refactor this code following best practices, improving readability and maintainability while preserving functionality." }, { name = "test", description = "Generate unit tests", details = "Create comprehensive unit tests covering edge cases, error scenarios, and various input conditions", prompt = "Please generate comprehensive unit tests for this code, covering edge cases and error scenarios." }, -- Add more custom shortcuts... } } ``` -------------------------------- ### Window Configuration Source: https://github.com/yetone/avante.nvim/blob/main/README.md Customize the appearance and behavior of Avante.nvim's windows, including sidebar position, width, header, spinners, and input/edit/ask window settings. ```lua windows = { ---@type "right" | "left" | "top" | "bottom" position = "right", -- the position of the sidebar wrap = true, -- similar to vim.o.wrap width = 30, -- default % based on available width sidebar_header = { enabled = true, -- true, false to enable/disable the header align = "center", -- left, center, right for title rounded = true, }, spinner = { editing = { "⡀", "⠄", "⠂", "⠁", "⠈", "⠐", "⠠", "⢀", "⣀", "⢄", "⢂", "⢁", "⢈", "⢐", "⢠", "⣠", "⢤", "⢢", "⢡", "⢨", "⢰", "⣰", "⢴", "⢲", "⢱", "⢸", "⣸", "⢼", "⢺", "⢹", "⣹", "⢽", "⢻", "⣻", "⢿", "⣿" }, generating = { "·", "✢", "✳", "∗", "✻", "✽" }, -- Spinner characters for the 'generating' state thinking = { "🤯", "🙄" }, -- Spinner characters for the 'thinking' state }, input = { prefix = "> ", height = 8, -- Height of the input window in vertical layout }, edit = { border = "rounded", start_insert = true, -- Start insert mode when opening the edit window }, ask = { floating = false, -- Open the 'AvanteAsk' prompt in a floating window start_insert = true, -- Start insert mode when opening the ask window border = "rounded", ---@type "ours" | "theirs" focus_on_apply = "ours", -- which diff to focus after applying }, }, ``` -------------------------------- ### Enable Codex with ACP Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configure Avante.nvim to use Codex as an ACP provider. Ensure OPENAI_API_KEY is set. ```lua { provider = "codex", -- other configuration options... } ``` -------------------------------- ### Configure Bedrock with AWS Profile and Region Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configure Bedrock within your Neovim setup to use a specific AWS profile and region. This is an alternative to setting environment variables when using the default AWS credentials provider chain. ```lua bedrock = { model = "us.anthropic.claude-3-5-sonnet-20241022-v2:0", aws_profile = "bedrock", aws_region = "us-east-1", }, ``` -------------------------------- ### Integrating img-clip.nvim for Image Pasting Source: https://github.com/yetone/avante.nvim/wiki/Home Configure keymaps to use `img-clip.nvim` for pasting images, with a condition to only use avante.nvim's clipboard functionality if the current filetype is `AvanteInput`. ```lua keys = { { "ip", function() return vim.bo.filetype == "AvanteInput" and require("avante.clipboard").paste_image() or require("img-clip").paste_image() end, desc = "clip: paste image", }, } ``` -------------------------------- ### Configure Blink.cmp Compat Source: https://github.com/yetone/avante.nvim/blob/main/README.md Enable compatibility for blink.cmp by listing the desired Avante features. This is for users of blink.cmp as an alternative to nvim-cmp. ```lua compat = { "avante_commands", "avante_mentions", "avante_files", } ``` -------------------------------- ### Avante.nvim AI Task Prompts Source: https://github.com/yetone/avante.nvim/wiki/Recipe-and-Tricks Defines various Lua string variables that serve as prompts for different AI-driven tasks within avante.nvim. These prompts guide the AI in performing actions like grammar correction, code analysis, and translation. ```lua -- NOTE: most templates are inspired from ChatGPT.nvim -> chatgpt-actions.json local avante_grammar_correction = 'Correct the text to standard English, but keep any code blocks inside intact.' local avante_keywords = 'Extract the main keywords from the following text' local avante_code_readability_analysis = "" You must identify any readability issues in the code snippet. Some readability issues to consider: - Unclear naming - Unclear purpose - Redundant or obvious comments - Lack of comments - Long or complex one liners - Too much nesting - Long variable names - Inconsistent naming and code style. - Code repetition You may identify additional problems. The user submits a small section of code from a larger file. Only list lines with readability issues, in the format | If there's no issues with code respond with only: " local avante_optimize_code = 'Optimize the following code' local avante_summarize = 'Summarize the following text' local avante_translate = 'Translate this into Chinese, but keep any code blocks inside intact' local avante_explain_code = 'Explain the following code' local avante_complete_code = 'Complete the following codes written in ' .. vim.bo.filetype local avante_add_docstring = 'Add docstring to the following codes' local avante_fix_bugs = 'Fix the bugs inside the following codes if any' local avante_add_tests = 'Implement tests for the following code' ``` -------------------------------- ### Configure Ollama Provider (New Method) Source: https://github.com/yetone/avante.nvim/wiki/Custom-providers This is the current, recommended method for configuring the Ollama provider. Note that the endpoint does not include '/v1'. Previous configurations are no longer valid. ```lua provider = "ollama", providers = { ollama = { endpoint = "http://127.0.0.1:11434", -- Note that there is no /v1 at the end. model = "qwq:32b", }, }, ``` -------------------------------- ### Configure Native Input Provider Source: https://github.com/yetone/avante.nvim/blob/main/README.md Use the default 'native' input provider, which relies on vim.ui.input. Provider options can be passed in 'provider_opts'. ```lua input = { provider = "native", provider_opts = {}, } ``` -------------------------------- ### Neotree Configuration for Avante Source: https://github.com/yetone/avante.nvim/blob/main/README.md Configure Neotree to add a shortcut for adding files to Avante's selected files. This snippet shows how to define a custom command and map it to a keybinding within Neotree's filesystem configuration. ```lua return { { 'nvim-neo-tree/neo-tree.nvim', config = function() require('neo-tree').setup({ filesystem = { commands = { avante_add_files = function(state) local node = state.tree:get_node() local filepath = node:get_id() local relative_path = require('avante.utils').relative_path(filepath) local sidebar = require('avante').get() local open = sidebar:is_open() -- ensure avante sidebar is open if not open then require('avante.api').ask() sidebar = require('avante').get() end sidebar.file_selector:add_selected_file(relative_path) -- remove neo tree buffer if not open then sidebar.file_selector:remove_selected_file('neo-tree filesystem [1]') end end, }, window = { mappings = { ['oa'] = 'avante_add_files', }, }, }, }) end, }, } ``` -------------------------------- ### Configure Selector Provider Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Set the selector provider and its options. Supports 'fzf_lua', 'telescope', and others. ```lua require("avante").setup({ selector = { provider = "fzf_lua", provider_opts = {}, }, }) ``` -------------------------------- ### Avante Tools - Create Directory Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Creates a new directory. ```APIDOC ## M.create_dir() ### Description Creates a new directory. ``` -------------------------------- ### Configure Avante.nvim with Custom Prompt Directory Source: https://github.com/yetone/avante.nvim/blob/main/doc/avante.txt Override Avante.nvim's built-in prompt templates by specifying a directory containing your custom prompt templates. This allows for dynamic prompt loading. ```lua require("avante").setup({ override_prompt_dir = vim.fn.expand("~/.config/nvim/avante_prompts"), }) ``` ```lua require("avante").setup({ override_prompt_dir = function() -- Your logic to determine the prompt directory return vim.fn.expand("~/.config/nvim/my_dynamic_prompts") end, }) ```