Skip to main content

What is ACP?

The Agent Client Protocol (ACP) is a standardized protocol that enables AI agents to communicate with development tools and environments. Avante.nvim now supports ACP, allowing seamless integration with AI agents that follow this unified communication protocol.

Key Benefits

ACP provides several advantages over traditional API-based providers:

Standardized Communication

A unified JSON-RPC based protocol for agent-client interactions

Enhanced Tool Access

Agents can directly interact with your file system, run commands, and access development tools

Persistent Context

Sessions maintain state across multiple interactions for better continuity

Fine-grained Permissions

Granular control over what agents can access and modify

Supported ACP Agents

Avante.nvim currently supports the following ACP-compatible agents:

Gemini CLI

Google’s Gemini agent with ACP support:
{
  provider = "gemini-cli",
  acp_providers = {
    ["gemini-cli"] = {
      command = "gemini",
      args = { "--experimental-acp" },
      env = {
        NODE_NO_WARNINGS = "1",
        GEMINI_API_KEY = os.getenv("GEMINI_API_KEY"),
      },
    },
  },
}

Claude Code

Anthropic’s Claude with ACP support:
{
  provider = "claude-code",
  acp_providers = {
    ["claude-code"] = {
      command = "npx",
      args = { "@zed-industries/claude-code-acp" },
      env = {
        NODE_NO_WARNINGS = "1",
        ANTHROPIC_API_KEY = os.getenv("ANTHROPIC_API_KEY"),
      },
    },
  },
}

Goose

Block’s Goose agent:
{
  provider = "goose",
  acp_providers = {
    ["goose"] = {
      command = "goose",
      args = { "acp" },
    },
  },
}

Codex

OpenAI’s Codex with ACP support:
{
  provider = "codex",
  acp_providers = {
    ["codex"] = {
      command = "npx",
      args = { "@zed-industries/codex-acp" },
      env = {
        NODE_NO_WARNINGS = "1",
        OPENAI_API_KEY = os.getenv("OPENAI_API_KEY"),
      },
    },
  },
}

Kimi CLI

Moonshot’s Kimi agent:
{
  provider = "kimi-cli",
  acp_providers = {
    ["kimi-cli"] = {
      command = "kimi",
      args = { "--experimental-acp" },
      env = {
        NODE_NO_WARNINGS = "1",
        MOONSHOT_API_KEY = os.getenv("MOONSHOT_API_KEY"),
      },
    },
  },
}

Prerequisites

Before using ACP agents, ensure you have the required tools installed:
1

Install Agent CLI

Install the specific CLI tool for your chosen agent:
npm install -g @google/generative-ai-cli
2

Set API Keys

Configure the necessary environment variables:
# For Gemini CLI
export GEMINI_API_KEY=your-gemini-api-key

# For Claude Code
export ANTHROPIC_API_KEY=your-anthropic-api-key

# For Codex
export OPENAI_API_KEY=your-openai-api-key

# For Kimi CLI
export MOONSHOT_API_KEY=your-moonshot-api-key
3

Configure Avante

Add the ACP provider configuration to your Avante setup.

Configuration

ACP providers are configured in the acp_providers section of your Avante configuration:
require('avante').setup({
  provider = "gemini-cli", -- or any other ACP provider
  acp_providers = {
    ["gemini-cli"] = {
      command = "gemini",
      args = { "--experimental-acp" },
      env = {
        NODE_NO_WARNINGS = "1",
        GEMINI_API_KEY = os.getenv("GEMINI_API_KEY"),
      },
    },
    -- Add other ACP providers as needed
  },
})

Configuration Options

command
string
required
The command to execute the ACP agent
args
table
Command-line arguments to pass to the agent
env
table
Environment variables to set for the agent process

ACP vs Traditional Providers

ACP agents can directly interact with your file system, run commands, and access development tools, providing more powerful automation capabilities than traditional API-based providers.
Sessions maintain state across multiple interactions, allowing agents to remember previous conversations and build upon earlier work.
Control exactly what agents can access and modify through a granular permission system.
Compatible with any ACP-compliant agent, ensuring future compatibility and flexibility.
When using ACP agents, the agent has more direct access to your development environment. Make sure you trust the agent provider and understand what permissions you’re granting.

Switching Providers

You can easily switch between different ACP providers using the command:
:AvanteSwitchProvider gemini-cli
Or use the model selector:
<Leader>a?

Providers

Learn about all available providers

Tools

Explore available LLM tools

Build docs developers (and LLMs) love