ElevenLabs CLI

Manage your voice agents as code from your command line.

Overview

The ElevenLabs CLI allows you to access your ElevenLabs agents from your terminal, unlocking new ways to manage them:

  • Store agents as code in your version control system
  • Set up CI/CD integration to automatically deploy your agents
  • Let your coding agent access and manage your voice agents
Prefer to jump straight to the code?

Find the complete source code and contribute on GitHub.

Installation

The CLI requires Node.js version 16.0.0 or higher.

$npm install -g @elevenlabs/cli

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

Quick start

1

Initialize a new project

$elevenlabs agents init

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

2

Authenticate with ElevenLabs

$elevenlabs auth login

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

3

Create your first agent

$elevenlabs agents add "My Assistant" --template assistant

This creates a new agent configuration using the assistant template.

4

Push to ElevenLabs platform

$elevenlabs 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
├── tests.json # Test definitions registry
├── agent_configs/ # Agent configuration files
├── tool_configs/ # Tool configuration files
└── test_configs/ # Test configuration files

Authentication

The CLI stores API keys in ~/.agents/api_keys.json file with restricted permissions (600).

Authentication commands

$elevenlabs auth login

Agent management

Creating agents

Create agents using pre-built templates:

$elevenlabs 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:

$elevenlabs 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

$elevenlabs agents templates list

Synchronization

Keep your local configurations synchronized with the ElevenLabs platform:

$elevenlabs agents push

Status and monitoring

Check agent status
$elevenlabs agents status

Import and export

$elevenlabs 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:

$elevenlabs agents tools add "API Integration" --type "webhook" --config-path ./config.json

Client tools

Direct client-side integrations:

$elevenlabs agents tools add "Client Function" --type "client" --config-path ./config.json

Widget generation

Generate HTML embed code for web integration:

$elevenlabs 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

Currently, only one environment is supported per account. Native support for environment separation is coming soon.

Meanwhile, this tool allows for virtual environment separation using different accounts as different virtual environments.

$$ elevenlabs auth login --env test # provide env key for test account
>$ elevenlabs agents add "agent" --env test
>$ elevenlabs agents push --env test

CI/CD pipeline integration

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