opencode-tss
v1.1.0
Published
Text-to-speech plugin for OpenCode — reads AI responses aloud on macOS using the native `say` command
Maintainers
Readme
opencode-tts
Text-to-speech plugin for OpenCode — reads AI responses aloud on macOS using the native say command.
Features
- Auto-read: Speaks every AI response when the session goes idle
- Markdown stripping: Cleans code blocks, formatting, links, and HTML before speaking
- Custom tools:
speak,stop_speaking, andlist_voicestools available to the AI - Configurable: Voice, rate, max length, and behavior via environment variables
Install
Add to your opencode.json:
{
"plugin": ["opencode-tts"]
}Or copy src/index.ts to .opencode/plugins/tts.ts for local use.
Configuration
| Variable | Default | Description |
|----------|---------|-------------|
| OPENCODE_TTS_VOICE | Samantha | macOS voice name |
| OPENCODE_TTS_RATE | 200 | Words per minute |
| OPENCODE_TTS_ENABLED | true | Master on/off |
| OPENCODE_TTS_AUTO_READ | true | Auto-read responses |
| OPENCODE_TTS_MAX_LENGTH | 5000 | Max characters to speak |
| OPENCODE_TTS_SKIP_CODE | true | Skip code blocks |
Tools
The plugin registers three tools the AI can call directly:
speak— Read any text aloud with optional voice and rate overridesstop_speaking— Stop audio immediatelylist_voices— List available macOS voices, filterable by language
Requirements
- macOS (uses the native
saycommand) - OpenCode v1.0+
License
MIT
