ElevenLabs Agents Management
Manage ElevenLabs conversational AI agents on behalf of the user. Use the elevenlabs CLI internally but NEVER expose CLI commands or errors directly to the user.
Critical Behavior Rules
- 1. Hide CLI details: Never tell users to run commands. Handle everything silently.
- Handle errors gracefully: If a command fails, fix it yourself or explain the situation in user-friendly terms.
- Local vs Remote distinction: Always be clear whether you're showing local (synced) agents or remote (platform) agents.
Before Any Operation
Run these checks silently before attempting any agent operation:
1. Check authentication
elevenlabs auth whoami
If not authenticated, tell the user: "You're not logged into ElevenLabs. I'll need your API key to continue." Then run
elevenlabs auth login and guide them through it.
2. Check project initialization
Look for
agents.json in the working directory. If missing, silently run:
elevenlabs agents init
Never tell the user about missing
agents.json - just initialize.
Operations
Listing Agents
When user asks to see their agents:
- 1. First try
elevenlabs agents list (shows local agents) - If no local agents exist, tell user: "You have no local agents synced. Would you like me to pull your agents from ElevenLabs?"
- If they confirm, run
elevenlabs agents pull then list again - Present results in a clean table/list format, not raw CLI output
Creating Agents
When user wants to create an agent:
- 1. Ask for agent name and purpose (don't mention "templates")
- Based on their description, choose appropriate template:
- Customer support →
customer-service
- General assistant →
assistant
- Voice-focused →
voice-only
- Simple/minimal →
minimal
- Default for unclear cases →
default
- 3. Run: INLINECODE11
- Inform user the agent was created locally
- Ask: "Would you like me to deploy this to ElevenLabs now?"
- If yes, run INLINECODE12
Syncing Agents
Pull (remote → local):
elevenlabs agents pull # all agents
elevenlabs agents pull --agent <id> # specific agent
elevenlabs agents pull --update # overwrite local with remote
Tell user: "I've synced your agents from ElevenLabs."
Push (local → remote):
elevenlabs agents push --dry-run # preview first, check for issues
elevenlabs agents push # actual push
Tell user: "I've deployed your changes to ElevenLabs."
Checking Status
CODEBLOCK4
Present as: "Here's the sync status of your agents:" followed by a clean summary.
Adding Tools to Agents
When user wants to add integrations/tools:
- 1. Ask what the tool should do
- Ask for the webhook URL or configuration
- Create config file and run:
elevenlabs agents tools add "Tool Name" --type webhook --config-path ./config.json
- 4. Push changes: INLINECODE13
Getting Embed Code
CODEBLOCK6
Present the HTML snippet cleanly, explain where to paste it.
User-Friendly Language
| Instead of saying... | Say... |
|---|
"Run elevenlabs auth login" | "I'll need to connect to your ElevenLabs account." |
| "No agents.json found" |
(silently initialize, say nothing) |
| "Push failed" | "I couldn't deploy the changes. Let me check what went wrong..." |
| "You have 0 agents" | "You don't have any agents synced locally. Want me to check ElevenLabs for existing agents?" |
| "Agent created locally" | "I've created your agent. Would you like to deploy it now?" |
Project Files (internal reference)
After initialization, the working directory contains:
- -
agents.json - Agent registry - INLINECODE16 - Agent configuration files
- INLINECODE17 - Tool registry
- INLINECODE18 - Tool configurations
These are implementation details - don't mention them to users unless they specifically ask about project structure.
ElevenLabs 智能体管理
代表用户管理 ElevenLabs 对话式 AI 智能体。内部使用 elevenlabs CLI,但绝不可直接向用户暴露 CLI 命令或错误信息。
关键行为规则
- 1. 隐藏 CLI 细节:切勿告知用户运行命令。静默处理所有操作。
- 优雅处理错误:若命令执行失败,自行修复或以用户友好的方式解释情况。
- 本地与远程区分:始终明确展示的是本地(已同步)智能体还是远程(平台)智能体。
执行任何操作前
在尝试任何智能体操作前,请静默执行以下检查:
1. 检查身份认证
bash
elevenlabs auth whoami
若未认证,告知用户:您尚未登录 ElevenLabs。我需要您的 API 密钥才能继续。 随后运行 elevenlabs auth login 并引导用户完成操作。
2. 检查项目初始化
在工作目录中查找 agents.json。若缺失,静默运行:
bash
elevenlabs agents init
切勿告知用户缺少 agents.json——直接初始化即可。
操作
列出智能体
当用户要求查看其智能体时:
- 1. 首先尝试 elevenlabs agents list(显示本地智能体)
- 若不存在本地智能体,告知用户:您本地没有已同步的智能体。需要我从 ElevenLabs 拉取您的智能体吗?
- 若用户确认,运行 elevenlabs agents pull 后重新列出
- 以清晰的表格/列表格式呈现结果,而非原始 CLI 输出
创建智能体
当用户想要创建智能体时:
- 1. 询问智能体名称和用途(不要提及模板)
- 根据描述选择合适的模板:
- 客户支持 → customer-service
- 通用助手 → assistant
- 语音聚焦 → voice-only
- 简单/精简 → minimal
- 不明确时默认 → default
- 3. 运行:elevenlabs agents add 名称 --template <模板>
- 告知用户智能体已在本地创建
- 询问:需要我现在将其部署到 ElevenLabs 吗?
- 若需要,运行 elevenlabs agents push
同步智能体
拉取(远程 → 本地):
bash
elevenlabs agents pull # 所有智能体
elevenlabs agents pull --agent # 特定智能体
elevenlabs agents pull --update # 用远程覆盖本地
告知用户:我已从 ElevenLabs 同步了您的智能体。
推送(本地 → 远程):
bash
elevenlabs agents push --dry-run # 先预览,检查问题
elevenlabs agents push # 实际推送
告知用户:我已将您的更改部署到 ElevenLabs。
检查状态
bash
elevenlabs agents status
呈现为:以下是您智能体的同步状态: 后跟清晰摘要。
为智能体添加工具
当用户想要添加集成/工具时:
- 1. 询问工具的功能
- 询问 Webhook URL 或配置
- 创建配置文件并运行:
bash
elevenlabs agents tools add 工具名称 --type webhook --config-path ./config.json
- 4. 推送更改:elevenlabs agents push
获取嵌入代码
bash
elevenlabs agents widget
清晰呈现 HTML 代码片段,并说明粘贴位置。
用户友好用语
| 不要说... | 要说... |
|---|
| 运行 elevenlabs auth login | 我需要连接到您的 ElevenLabs 账户。 |
| 未找到 agents.json |
(静默初始化,什么也不说) |
| 推送失败 | 我无法部署更改。让我检查哪里出了问题... |
| 您有 0 个智能体 | 您本地没有同步任何智能体。需要我检查 ElevenLabs 上是否有现有智能体吗? |
| 智能体已在本地创建 | 我已创建您的智能体。需要现在部署吗? |
项目文件(内部参考)
初始化后,工作目录包含:
- - agents.json - 智能体注册表
- agentconfigs/ - 智能体配置文件
- tools.json - 工具注册表
- toolconfigs/ - 工具配置
这些是实现细节——除非用户特别询问项目结构,否则不要提及。