💡 摘要
一个用于AI代理语音通知的CLI工具,使用ElevenLabs TTS。
🎯 适合人群
🤖 AI 吐槽: “看起来很能打,但别让配置把人劝退。”
风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);API Key/Token 的获取、存储与泄露风险;文件读写范围与路径穿越风险;依赖锁定与供应链风险。以最小权限运行,并在生产环境启用前审计代码与依赖。
Agent Speak
CLI tool for AI agent speech notifications using ElevenLabs TTS.
Installation
npm install -g agent-speak
Or run without installing:
npx agent-speak "Hello world"
Setup
Set your ElevenLabs API key:
agent-speak config set-key <your-api-key>
Or use the environment variable:
export ELEVENLABS_API_KEY=<your-api-key>
Usage
# Speak a message agent-speak "Task complete" # Auto-select voice based on worktree (recommended for agents) agent-speak --worktree "$(pwd)" "Task complete" # Use a specific voice preset agent-speak --voice josh "Hello world" # Override ElevenLabs model agent-speak --model eleven_turbo_v2_5 "Hello world" # List available voice presets agent-speak voices # Show current config and where values come from agent-speak config show
Voice Selection
Worktree-based (recommended)
Use --worktree to automatically select a consistent voice based on the working directory. Different worktrees get different voices, making it easy to distinguish between multiple agents.
agent-speak --worktree "$(pwd)" "Build finished"
Voice presets
13 preset voices are available:
| Name | Description | |------|-------------| | rachel | Calm female, American | | bella | Soft female, American | | elli | Emotional female, American | | freya | Expressive female, American | | nicole | Whisper female, American | | domi | Confident female, American | | josh | Deep male, American | | adam | Deep male, American | | sam | Raspy male, American | | arnold | Narrative male, American | | dave | Conversational male, British | | fin | Sailor male, Irish | | clyde | War veteran male, American |
agent-speak --voice bella "Tests passed"
Configuration
Config is stored in ~/.agent-speak/config.json:
{ "apiKey": "your-api-key", "voiceId": "rachel" }
Config Commands
# Set API key agent-speak config set-key <api-key> # Set default voice agent-speak config set-voice <name> # Show merged config and sources (env vs config file) agent-speak config show
Platform Support
- macOS: Uses
afplay - Linux: Uses
mpv - Windows: Uses PowerShell
For AI Agents
A skill is included at skills/agent-speak/SKILL.md that teaches agents when and how to use this tool.
优点
- 易于安装和使用。
- 支持多种语音预设。
- 可针对不同环境进行配置。
缺点
- 需要API密钥才能使用。
- 仅限于ElevenLabs的语音选项。
- 配置可能对新用户来说比较复杂。
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 Kaizhi.
