Package Exports
- opencode-interrupt-plugin
- opencode-interrupt-plugin/tui
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 hold the spacebar to redirect the model on the fly.
Installation
Add both the server plugin and the TUI plugin to your ~/.config/opencode/opencode.json:
{
"plugin": [
"opencode-interrupt-plugin",
"opencode-interrupt-plugin/tui"
]
}The server plugin handles TTS streaming, voice overlap detection, and interrupt injection. The TUI plugin adds the walkie-talkie keybinding (space).
Usage
Walkie-Talkie Mode
Hold down the spacebar while speaking, then release it to redirect the model:
- The model is generating a response — TTS is playing
- Press and hold spacebar — generation aborts, TTS stops, mic starts recording
- Speak your correction while holding spacebar
- Release spacebar — audio is transcribed via Whisper and sent as your next message
- The model responds to your correction
[Model speaking] → hold space → speak correction → release space → 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 (server plugin)
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
- TUI plugin: Registers a
spacekeybinding in OpenCode's TUI keymap; key repeats while held keep the recording active; 300ms of silence after release triggers transcription and redirect