Package Exports
- opencode-interrupt-plugin
Readme
OpenCode Interrupt Plugin
Streaming TTS + voice interruption for OpenCode. Speaks responses as they arrive and detects when you talk over it. Walkie-talkie mode lets you type /ptt to redirect the model on the fly.
Installation
Add the plugin to your ~/.config/opencode/opencode.json:
{
"plugin": [
"opencode-interrupt-plugin"
]
}The plugin handles TTS streaming, voice overlap detection, interrupt injection, and the /ptt walkie-talkie slash command.
Usage
Walkie-Talkie Mode
Type /ptt to toggle recording, speak, then type /ptt again to send:
- The model is generating a response — TTS is playing
- Type
/ptt— generation aborts, TTS stops, mic starts recording - Speak your correction
- Type
/pttagain — audio is transcribed via Whisper and sent as your next message - The model responds to your correction
[Model speaking] → type /ptt → speak correction → type /ptt → model redirectsRequires whisper.cpp with the base model installed.
Run the one-command install script:
bash scripts/install-whisper.shOr set OPENAI_API_KEY in your environment as a fallback.
Voice Interruption
When TTS is playing, just speak — the plugin detects your voice, stops TTS, and marks the session for correction injection.
Configuration
| Setting | Type | Default | Description |
|---|---|---|---|
licenseKey |
string | none | License key (omit for free mode) |
micThreshold |
number | 0.008 | Voice activation threshold (free mode locked) |
timingWindowMs |
number | 3000 | How long after interrupt to accept corrections |
Environment Variables
OPENAI_API_KEY— optional fallback for Whisper transcription (used ifwhisperCLI is not found)WHISPER_MODEL— path to whisper.cpp model file (default:~/.local/bin/ggml-base.bin)EDGE_TTS_VOICE— TTS voice (default:en-US-AriaNeural)
How It Works
- Server plugin: Monitors mic via sox (continuous PCM pipe), detects voice during TTS playback, injects correction context into the next LLM request
/pttcommand:command.execute.beforehook intercepts/ptt, toggles recording on/off, transcribes via whisper.cpp, and sends the transcript viasession.prompt()