Command System
Relevant source files
The following files were used as context for generating this wiki page:
The voice-elevenlabs plugin provides a suite of commands to integrate text-to-speech, speech-to-text, and voice management capabilities directly within the Claude Code environment. These commands leverage the ElevenLabs v3 API to offer features like emotional speech synthesis, multi-speaker dialogues, custom voice creation, and audio transcription. The system is designed to be invoked via simple slash commands, making it easy to add a voice dimension to development workflows and interactions.
The command system is the primary user-facing interface of the plugin, enabling direct control over voice generation and configuration. It works in tandem with automated Hooks and a Voice Assistant Agent to provide a comprehensive voice experience.
Sources: README.md:1-10, 26-37, agents/voice-assistant.md:1-6
Command Overview
The plugin exposes several commands, each targeting a specific function of the ElevenLabs API.
| Command | Description |
|---|---|
/speak [text] | Speak text with optional emotion tags like [excited], [whispers]. |
/dialogue | Generate multi-speaker conversations with natural timing and interruptions. |
/create-voice | Create a custom voice from a text description using Voice Design v3. |
/transcribe | Convert an audio file (local or URL) to text using Scribe v2. |
/voices | List available ElevenLabs voices from your account. |
/voice-config | View and modify voice settings, such as the default voice ID. |
Sources: README.md:28-37
Core Speech Generation
These commands are used for generating spoken audio from text.
/speak
The /speak command converts a given text string into speech. It supports ElevenLabs v3 Audio Tags, which allow for adding emotional nuance to the synthesized voice.
Sources: commands/speak.md:1-6
Features:
- Text-to-Speech: Converts any string into spoken audio.
- Emotion Control: Uses inline tags to control the delivery style.
Available Emotion Tags:
[excited][whispers][laughs]/[laughing][sighs][angry][sad][nervous][shouting][sarcastically]
Sources: commands/speak.md:10-20, README.md:41-54
The following diagram illustrates the data flow for the /speak command.
Sources: commands/speak.md:27-33
/dialogue
This command generates realistic, multi-speaker conversations from a formatted script. It utilizes ElevenLabs v3's dialogue mode for natural timing and interruptions.
Sources: commands/dialogue.md:1-6
Features:
- Multi-Speaker: Supports multiple speakers in a single audio generation.
- Natural Interruptions: A speaker can cut another off by using a trailing em-dash (
—). - Per-Speaker Emotion: Each speaker's line can have its own emotion tags.
- Voice Assignment: Voices can be assigned to speakers explicitly (e.g.,
Alice (voice: Rachel): ...) or assigned automatically.
The script format requires speaker names followed by their lines.
Example Usage:
/dialogue "Alice: Hey, did you see the new feature?
Bob: [excited] Yes! It's incredible!
Alice: [laughs] I knew you'd love it."
Sources: commands/dialogue.md:8-15, 29-32
Voice Management
These commands allow users to create, list, and configure the voices used for speech generation.
/create-voice
Generates a unique AI voice from a natural language text description using ElevenLabs Voice Design v3. This command does not require any audio samples. The user provides a description, and the API returns voice candidates to choose from.
Description Tips:
- Age:
young,middle-aged - Gender:
male,female - Accent:
British,Southern US - Tone:
warm,authoritative - Quality:
clear,raspy
Sources: commands/create-voice.md:1-16
The process for creating a new voice is shown below.
Sources: commands/create-voice.md:34-39
/voices
This command lists the available voices in the user's ElevenLabs account. It displays a default list of popular voices and provides a curl command to fetch all voices associated with the user's API key.
Default Voices:
| Voice | ID | Style |
|---|---|---|
| George | JBFqnCBsd6RMkjVDRZzb | Natural male (default) |
| Adam | pNInz6obpgDQGcFmaJgB | Deep male |
| Rachel | 21m00Tcm4TlvDq8ikWAM | Natural female |
| Domi | AZnzlk1XvdvUeBnXmlld | Young female |
Sources: commands/voices.md:8-16, README.md:71-78
To change the active voice, the ELEVENLABS_VOICE_ID environment variable must be set.
export ELEVENLABS_VOICE_ID="pNInz6obpgDQGcFmaJgB"
Sources: commands/voices.md:18-22
/voice-config
Manages the voice configuration. It allows users to show the current settings, set a new default voice, or test the current configuration.
Actions:
show: Displays the current voice ID and API key status.set-voice [voice_id]: Changes the default voice.test: Plays a test message using the current settings.
Sources: commands/voice-config.md:8-21
Audio Processing
/transcribe
Converts speech from an audio file into text using ElevenLabs Scribe v2. It can process audio from a local file path or a URL.
Features:
- High-accuracy speech-to-text.
- Supports multiple audio formats (MP3, WAV, M4A, etc.).
- Can identify and label different speakers (diarization).
- Provides word-level timestamps.
Usage:
# From a local file
/transcribe file:/path/to/audio.mp3
# From a URL
/transcribe url:https://example.com/audio.mp3
Sources: commands/transcribe.md:1-20
Summary
The command system for voice-elevenlabs provides a powerful and user-friendly interface for interacting with the ElevenLabs API. Through a set of intuitive commands, users can generate expressive speech, create complex dialogues, manage a library of voices, and transcribe audio, all from within the Claude Code terminal. This system is the cornerstone of the plugin's functionality, enabling developers to seamlessly integrate voice into their workflows.
Sources: README.md:8-10, 26-27