speak

January 30, 2026 · View on GitHub

Convert text to speech using a local or remote TTS engine.

Usage

agent-cli speak [TEXT]

Description

A straightforward text-to-speech utility:

  1. Takes text from a command-line argument or your clipboard
  2. Sends the text to a TTS server
  3. Plays the generated audio through your speakers

Examples

# Speak from argument
agent-cli speak "Hello, world!"

# Speak from clipboard
agent-cli speak

# Save to file instead of playing
agent-cli speak "Hello" --save-file hello.wav

# List audio output devices
agent-cli speak --list-devices

Options

Provider Selection

OptionDefaultDescription
--tts-providerwyomingThe TTS provider to use ('wyoming', 'openai', 'kokoro', 'gemini').

Audio Output

OptionDefaultDescription
--output-device-index-Audio output device index (see --list-devices for available devices).
--output-device-name-Partial match on device name (e.g., 'speakers', 'headphones').
--tts-speed1.0Speech speed multiplier (1.0 = normal, 2.0 = twice as fast, 0.5 = half speed).

Audio Output: Wyoming

OptionDefaultDescription
--tts-wyoming-iplocalhostWyoming TTS server IP address.
--tts-wyoming-port10200Wyoming TTS server port.
--tts-wyoming-voice-Voice name to use for Wyoming TTS (e.g., 'en_US-lessac-medium').
--tts-wyoming-language-Language for Wyoming TTS (e.g., 'en_US').
--tts-wyoming-speaker-Speaker name for Wyoming TTS voice.

Audio Output: OpenAI-compatible

OptionDefaultDescription
--tts-openai-modeltts-1The OpenAI model to use for TTS.
--tts-openai-voicealloyVoice for OpenAI TTS (alloy, echo, fable, onyx, nova, shimmer).
--tts-openai-base-url-Custom base URL for OpenAI-compatible TTS API (e.g., http://localhost:8000/v1 for a proxy).

Audio Output: Kokoro

OptionDefaultDescription
--tts-kokoro-modelkokoroThe Kokoro model to use for TTS.
--tts-kokoro-voiceaf_skyThe voice to use for Kokoro TTS.
--tts-kokoro-hosthttp://localhost:8880/v1The base URL for the Kokoro API.

Audio Output: Gemini

OptionDefaultDescription
--tts-gemini-modelgemini-2.5-flash-preview-ttsThe Gemini model to use for TTS.
--tts-gemini-voiceKoreThe voice to use for Gemini TTS (e.g., 'Kore', 'Puck', 'Charon', 'Fenrir').

LLM: Gemini

OptionDefaultDescription
--gemini-api-key-Your Gemini API key. Can also be set with the GEMINI_API_KEY environment variable.

Audio Input

OptionDefaultDescription
--list-devicesfalseList available audio devices with their indices and exit.

General Options

OptionDefaultDescription
--save-file-Save audio to WAV file instead of playing through speakers.
--log-levelwarningSet logging level.
--log-file-Path to a file to write logs to.
--quiet, -qfalseSuppress console output from rich.
--jsonfalseOutput result as JSON (implies --quiet and --no-clipboard).
--config-Path to a TOML configuration file.
--print-argsfalsePrint the command line arguments, including variables taken from the configuration file.

Process Management

OptionDefaultDescription
--stopfalseStop any running instance of this command.
--statusfalseCheck if an instance is currently running.
--togglefalseStart if not running, stop if running. Ideal for hotkey binding.

Available Voices

Wyoming (Piper)

List available voices:

# Check Piper documentation or run with verbose logging
agent-cli speak --log-level DEBUG "test"

Common voices:

  • en_US-lessac-medium - US English, natural
  • en_GB-alan-medium - British English
  • de_DE-thorsten-medium - German

OpenAI

  • alloy, echo, fable, onyx, nova, shimmer

Kokoro

  • af_sky, af_bella, am_adam, and more

Gemini

  • Kore (default), Puck, Charon, Fenrir

Use Cases

Read Clipboard Aloud

agent-cli speak

Speed Up Audio

agent-cli speak "Long text here" --tts-speed 1.5

Save for Later

agent-cli speak "Important reminder" --save-file reminder.wav