steipete/sag

Like the macOS say command, but with a modern voice.

What it solves

sag is a command-line interface (CLI) tool that provides a simple, "Mac-style" way to generate speech from text using high-quality AI voice providers. It replaces the need for complex API calls or GUI tools by allowing users to stream audio directly to their speakers or save it to files using a single command.

How it works

The tool acts as a wrapper for two primary text-to-speech (TTS) providers: ElevenLabs and 60db. It handles the API authentication, voice selection, and audio playback. Users can either call it like the macOS say command (passing text directly) or use specific subcommands to manage voices and settings.

Who it’s for

Developers, system administrators, and creators who want to integrate high-quality AI speech into their terminal workflows, scripts, or AI agents without needing to write custom API integration code.

Highlights

  • Provider Support: Supports ElevenLabs and 60db with automatic provider selection based on configured API keys.
  • Streaming Playback: Ability to stream audio directly to speakers in real-time while it is being generated.
  • Voice Discovery: Built-in commands to search, list, and filter voices by language, use case, or labels.
  • Flexible Output: Supports saving audio to various formats (MP3, WAV, PCM) based on the output file extension.
  • Granular Control: Provides flags for speed, stability, similarity, style, and latency tiers to fine up-tune the voice delivery.
  • Model Selection: Access to multiple ElevenLabs models, including v3 for expressive acting and v2.5 Flash for ultra-low latency.

Related

  • Project
  • Project
  • Project
  • Project