Agents Platform CLI

Manage ElevenLabs Agents using an "agents as code" approach with local configuration files.

Overview

The ElevenLabs Agents Platform CLI transforms how you build and deploy ElevenLabs agents by treating them as code. Instead of manually configuring agents through web interfaces, you define them in version-controlled configuration files and deploy them like any other application.

The CLI also provides a local scratch pad that coding agents like claude code can use to reason about your voice agents. Whether you’re auto-generating customer support bots from your existing documentation, creating personalized sales agents for each client, or building docs agents that stay synchronized with your codebase, the CLI makes it effortless.

Prefer to jump straight to the code?

Find the complete source code and contribute on GitHub.

What you can build

  • Instant docs agents: Generate agents from your API documentation that are always up-to-date with your latest changes
  • Site-aware assistants: Parse your Vercel app routes and components to create agents that understand your application structure
  • Integration-ready bots: Connect to your existing APIs, databases, and tools through webhook and client-side integrations

Key features

  • Agents as Code: Version control your AI agents alongside your application code—never lose track of changes or accidentally overwrite production configurations
  • Multi-environment Support: Deploy the same agent logic across dev, staging, and production with environment-specific configurations and API keys
  • Secure Authentication: Production-ready security with secure file storage and environment variable support for CI/CD pipelines
  • Tool Management: Connect to any API, database, or service through webhook and client-side tool integrations with built-in authentication

Installation

The CLI requires Node.js version 16.0.0 or higher.

$npm install -g @elevenlabs/agents-cli

After installation, the agents command will be available globally in your terminal.

Quick start

1

Initialize a new project

$agents init

This creates the project structure with configuration directories and registry files.

2

Authenticate with ElevenLabs

$agents login

Enter your ElevenLabs API key when prompted. The CLI will verify the key and store it securely.

3

Create your first agent

$agents add "My Assistant" --template assistant

This creates a new agent configuration using the assistant template.

4

Push to ElevenLabs platform

$agents push

This uploads your local agent configuration to the ElevenLabs platform.

Project structure

The CLI creates a structured project directory:

your_project/
├── agents.json # Central agent configuration registry
├── tools.json # Tool definitions registry
├── agent_configs/ # Environment-specific agent configs
│ ├── prod/ # Production environment configs
│ ├── dev/ # Development environment configs
│ └── staging/ # Staging environment configs
└── tool_configs/ # Tool configuration files

Authentication

The CLI uses a multi-layered authentication system for secure API key management:

  1. Environment variables (highest priority): ELEVENLABS_API_KEY (only for ‘prod’ environment) 2. Secure file storage: ~/.agents/api_keys.json with restricted permissions (600)

Authentication commands

$agents login

Agent management

Creating agents

Create agents using pre-built templates:

$agents add "Agent Name" [options]

Options:

  • --template <type>: Choose from available templates (default: default)
  • --env <env>: Target environment (default: prod)
  • --skip-upload: Create locally without uploading to platform

Example:

$agents add "Customer Support Bot" --template customer-service --env prod

Templates

The CLI provides six pre-built templates for common use cases:

Complete configuration with all available fields, sensible defaults, full voice/text support, widget customization, and evaluation criteria.

Essential fields only including basic prompt, language, TTS, and conversation settings.

Optimized for voice interactions with disabled text input and advanced voice settings.

Text-focused conversations with disabled voice features.

Professional empathetic prompts, low temperature (0.1), 30-minute duration, and evaluation criteria.

General-purpose AI assistant with balanced creativity (temperature 0.3) and versatile voice/text support.

Template commands

$agents templates list

Synchronization

Keep your local configurations synchronized with the ElevenLabs platform:

$agents push

Status and monitoring

Check agent status
$agents status

Import and export

$agents pull --env prod

Tool management

The CLI supports two types of tools for extending agent capabilities:

Webhook tools

HTTP API integrations with authentication and timeout configuration:

$agents add-webhook-tool "API Integration" --config-path ./tool-config.json

Client tools

Direct client-side integrations:

$agents add-client-tool "Client Function" --config-path ./client-config.json

Widget generation

Generate HTML embed code for web integration:

$agents widget <agent_id>

This outputs HTML code like:

1<elevenlabs-convai agent-id="agent_id_here"></elevenlabs-convai>
2<script src="https://unpkg.com/@elevenlabs/convai-widget-embed" async></script>

Configuration files

Agent configuration structure

Each agent configuration includes:

1{
2 "name": "Agent Name",
3 "conversation_config": {
4 "agent": {
5 "prompt": "You are a helpful assistant...",
6 "llm": {
7 "model": "eleven-multilingual-v1",
8 "temperature": 0.3
9 },
10 "language": "en",
11 "tools": []
12 },
13 "tts": {
14 "model": "eleven-multilingual-v1",
15 "voice_id": "pNInz6obpgDQGcFmaJgB",
16 "audio_format": {
17 "format": "pcm",
18 "sample_rate": 44100
19 }
20 },
21 "asr": {
22 "model": "nova-2-general",
23 "language": "auto"
24 },
25 "conversation": {
26 "max_duration_seconds": 1800,
27 "text_only": false,
28 "client_events": []
29 }
30 },
31 "platform_settings": {
32 "widget": {
33 "conversation_starters": [],
34 "branding": {}
35 }
36 },
37 "tags": ["environment:dev"]
38}

Environment management

The CLI supports multiple environments with separate configurations:

$agents add "Test Bot" --env dev
>agents push --env dev

CI/CD pipeline integration

1# In your GitHub Actions workflow
2- name: Deploy Agents Platform agents
3 run: |
4 npm install -g @elevenlabs/agents-cli
5 export ELEVENLABS_API_KEY=${{ secrets.ELEVENLABS_API_KEY }}
6 agents push --env prod --dry-run # Preview changes
7 agents push --env prod # Deploy
8 agents status # Verify deployment