Build multimodal agents with the ElevenLabs platform.
Manage ElevenLabs with local configuration files. This tool is an experimental exploration of treating agents as code, with features like templates and automatic pushing.
- Agent Configuration: Full ElevenLabs agent schema support
- Templates: Pre-built templates for common use cases
- Smart Updates: Hash-based change detection
- Import/Export: Fetch existing agents and tools from workspace
- Tool Management: Import and manage tools from ElevenLabs workspace
- Widget Generation: HTML widget snippets
- Secure Storage: OS keychain integration with secure file fallback
# Global installation
pnpm install -g @elevenlabs/cli
# OR
npm install -g @elevenlabs/cli
# One-time usage
pnpm dlx @elevenlabs/cli init
# OR
npx @elevenlabs/cli initLogin with your ElevenLabs API key (stored securely across all platforms):
elevenlabs auth loginOr set environment variable:
export ELEVENLABS_API_KEY="your_api_key_here"Note: For now, your API key must be unrestricted to work with the CLI, as ElevenLabs-restricted keys are not available yet.
elevenlabs auth whoamiConfigure the API residency for isolated regions:
# Set to EU residency (uses api.eu.elevenlabs.io)
elevenlabs auth residency eu-residency
# Set to India residency (uses api.in.elevenlabs.io)
elevenlabs auth residency in-residency
# Set to US/Global (uses api.elevenlabs.io or api.us.elevenlabs.io)
elevenlabs auth residency global # or 'us'elevenlabs auth logoutThe ElevenLabs CLI supports managing agents, tools, and tests across multiple isolated environments (e.g., dev, staging, prod).
# Login with your API key
elevenlabs auth loginelevenlabs auth whoami
# Shows your authentication statuselevenlabs auth logout# 1. Initialize project
elevenlabs agents init
# Or override existing configuration
elevenlabs agents init --override
# 2. Login with API key
elevenlabs auth login
# 3. Create agent with template
elevenlabs agents add "Support Bot" --template customer-service
# 4. Edit configuration (agent_configs/support_bot.json)
# 5. Sync to ElevenLabs
elevenlabs agents pushNote: This example uses the default 'prod' environment. For multi-environment workflows, see Multi-Environment Management and Multi-Environment Workflows.
your_project/
├── agents.json # Central configuration with env field per agent
├── tools.json # Tool configurations with env field per tool
├── tests.json # Test configurations with env field per test
├── agent_configs/ # Agent configuration files
├── tool_configs/ # Tool configurations
└── test_configs/ # Test configurations
The elevenlabs agents init command sets up the project structure for managing ElevenLabs agents:
elevenlabs agents init # Initialize in current directory
elevenlabs agents init ./my-project # Initialize in specific directory
elevenlabs agents init --override # Override existing files and recreate from scratchDefault behavior: When you run elevenlabs agents init, it will:
- Create missing files and directories
- Skip existing files (shown as "skipped" in output)
- Preserve your existing configuration
Override mode (--override): When you need to reset your project:
- Overwrites all configuration files
- Recreates directory structure from scratch
- Warning: This will delete all existing configurations in
agent_configs/,tool_configs/, andtest_configs/
Use --override when:
- You want to start fresh with a clean configuration
- Your configuration has become inconsistent
- You're setting up a new environment and want to ensure clean state
# Authentication
elevenlabs auth login
elevenlabs auth logout
elevenlabs auth whoami
# Create agent
elevenlabs agents add "Agent Name" [--template customer-service]
# Create webhook tool
elevenlabs tools add-webhook "Tool Name" [--config-path path]
# Create client tool
elevenlabs tools add-client "Tool Name" [--config-path path]
# Push changes
elevenlabs agents push [--agent "Agent Name"] [--dry-run]
# Sync tools
elevenlabs tools push [--tool "Tool Name"] [--dry-run]
# Sync tests
elevenlabs tests push [--dry-run]
# Check status
elevenlabs agents status [--agent "Agent Name"]
# Pull agents from ElevenLabs
elevenlabs agents pull [--search "term"] [--dry-run]
# Pull tools from ElevenLabs
elevenlabs tools pull [--search "term"] [--tool "tool-name"] [--dry-run] [--output-dir tool_configs]
# Import tests from ElevenLabs
elevenlabs tests pull [--output-dir test_configs] [--dry-run]
# Create and run test
elevenlabs tests add "Test Name" [--template basic-llm]
# Run tests
elevenlabs agents test "Agent Name"
# Generate widget HTML (includes server-location for isolated regions)
elevenlabs agents widget "Agent Name"
# List agents
elevenlabs agents list
# Delete agent (removes locally and from ElevenLabs)
elevenlabs agents delete <agent_id>
# Delete tool locally and from ElevenLabs
elevenlabs tools delete <tool_id>
# Delete all tools
elevenlabs tools delete --all
# Delete test locally and from ElevenLabs
elevenlabs tests delete <test_id>
# Delete all tests
elevenlabs tests delete --all
# Add componenents from [ui.elevenlabs.io](https://ui.elevenlabs.io)
elevenlabs components add "Component Name"# List available templates
elevenlabs agents templates list
# Show template details
elevenlabs agents templates show customer-serviceComplete configuration with all available fields and sensible defaults. Includes full voice and text support, widget customization, evaluation criteria, and platform settings. Best for production deployments requiring comprehensive configuration.
Minimal configuration with only essential fields. Contains basic agent prompt, language settings, TTS configuration, and conversation settings. Perfect for quick prototyping and simple use cases.
Optimized for voice-only conversations. Disables text input and focuses on voice interaction features. Includes advanced voice settings, turn management, and audio processing optimizations.
Optimized for text-only conversations. Disables voice features and focuses on text-based interactions.
Pre-configured for customer service scenarios. Features professional, empathetic prompts with consistent responses (low temperature). Includes extended conversation duration (30 minutes), evaluation criteria for service quality, and customer-service tags.
General purpose AI assistant configuration. Balanced creativity settings with helpful, knowledgeable prompts. Supports both voice and text interactions for versatile use cases like Q&A, explanations, and analysis tasks.
{
"name": "Support Bot",
"conversation_config": {
"agent": {
"prompt": {
"prompt": "You are a helpful customer service representative.",
"llm": "gemini-2.0-flash",
"temperature": 0.1
},
"language": "en"
},
"tts": {
"model_id": "eleven_turbo_v2",
"voice_id": "cjVigY5qzO86Huf0OWal"
}
},
"tags": ["customer-service"]
}New Project:
elevenlabs agents init
elevenlabs auth login
elevenlabs agents add "My Agent" --template assistant
elevenlabs agents pushImport Existing:
elevenlabs agents init
elevenlabs auth login
elevenlabs agents pull
elevenlabs agents pushImport and Use Tools:
elevenlabs agents init
elevenlabs auth login
elevenlabs tools pull
# Edit tool configs in tool_configs/
# Tools will have 'env' field - modify if needed
# Reference tools in your agent configurations
elevenlabs agents pushDelete Agent:
# List agents to find the agent ID
elevenlabs agents list
# Delete agent by ID (removes locally and from ElevenLabs)
elevenlabs agents delete agent_123456789# List all agents across all environments
elevenlabs agents list
# Push all agents to their respective environments
elevenlabs agents push
# Pull agents from all configured environments
elevenlabs agents pullAuthentication Issues:
# Check login status
elevenlabs auth whoami
# Login again
elevenlabs auth login
# Or use environment variable
export ELEVENLABS_API_KEY="your_api_key_here"Agent Not Found:
- Check:
elevenlabs agents list - Verify:
elevenlabs agents status
Push Issues:
- Preview:
elevenlabs agents push --dry-run - Check:
elevenlabs agents status
Reset Project:
elevenlabs agents init --override
elevenlabs auth login
elevenlabs agents push# Install dependencies
pnpm install
# Build
pnpm run build
# Test
pnpm test
# Lint
pnpm run lintnpm testCRITICAL: E2E tests require a dedicated, empty test account.
DO NOT use your production account! E2E tests will create, modify, and delete agents during testing. Any existing agents could be permanently lost.
Setup:
- Create a new ElevenLabs account (separate from production)
- Verify the account is completely empty (no deployed agents)
- Generate an API key for this test account
- Copy
.env.exampleto.envand add the test account API key - Run:
npm run test:e2e
Quick safety check before running tests:
npm run dev -- auth whoami --no-ui # Verify you're using test account
npm run dev -- agents list --no-ui # Should be empty or only test agentsThe ElevenLabs CLI stores your API key securely with multiple fallback options:
- Environment Variable:
ELEVENLABS_API_KEYtakes highest priority for CI/CD - OS Keychain: Uses native credential store (keytar) when available
- Secure File: Falls back to
~/.elevenlabs/api_keywith restricted permissions (600)
Configuration files are stored in ~/.elevenlabs/ with secure directory permissions (700 on Unix-like systems).
- Use
elevenlabs --helporelevenlabs <command> --help - Check GitHub issues
- Create new issue with problem details
