Use your microphone to dictate into the OpenCode terminal UI. OpenCode Voice transcribes the recording and inserts the text into the active prompt. You review and submit the prompt yourself.
Important
OpenCode Voice 0.0.x is prerelease software. It supports Linux x64, requires Node.js 22.22.2, and declares compatibility with OpenCode >=1.18.3 <2. Microphone capture is experimental.
Install the plugin globally:
opencode plugin @moozie/opencode-voice --globalOpen OpenCode, then:
- Run
OpenCode Voice: Configfrom the command palette. - Select a transcription provider and microphone.
- Press
Ctrl+X Vto start recording. - Press
Enterto stop and transcribe. - Edit the transcript in the prompt, then submit it normally.
Pressing Ctrl+X V before setup opens the configuration screen.
| Requirement | Version or platform |
|---|---|
| Operating system | Linux x64 |
| Node.js | 22.22.2 |
| OpenCode | >=1.18.3 <2 |
Microphone capture also requires one of these commands on your PATH:
ffmpegfor PulseAudio or PipeWire-Pulsepw-recordfor native PipeWirearecordfromalsa-utilsfor ALSA
For the default system microphone, OpenCode Voice tries the available backends in the order shown above.
A specifically selected microphone uses its detected backend without fallback. If that device disconnects, select another device or switch to Default system microphone.
| Action | Control |
|---|---|
| Start recording | Ctrl+X V |
| Stop and transcribe | Enter or Ctrl+X V |
| Cancel and discard | Press Esc twice within 3 seconds |
| Open settings | OpenCode Voice: Config |
While recording, the prompt footer shows the recording state and elapsed time. It can also display a live microphone-level waveform.
Voice controls override normal OpenCode shortcuts until recording stops.
The default recording limit is five minutes. You can set it anywhere from 10 seconds to 30 minutes. Recording stops automatically at the configured limit.
| Provider | Audio leaves your machine | Credential | Models |
|---|---|---|---|
| Local Whisper | No | None | Managed Whisper models or a custom whisper-cli |
| OpenAI | Yes | OPENAI_API_KEY or an exposed OpenCode-managed key |
gpt-4o-mini-transcribe, gpt-4o-transcribe |
| ElevenLabs | Yes | ELEVENLABS_API_KEY |
scribe_v2, scribe_v1 |
| Handy | No | None | Models installed in Handy |
Local Whisper runs on your CPU and does not send audio to a cloud provider. OpenCode Voice downloads and verifies a pinned build of whisper.cpp and the selected model.
The managed models are English-only:
| Model | Download | Notes |
|---|---|---|
tiny.en |
78 MB | Fastest; lowest accuracy |
base.en |
148 MB | Lightweight general use |
small.en |
488 MB | Better accuracy; higher CPU use |
large-v3-turbo-q5_0 |
574 MB | Best managed local quality; highest CPU use |
The configuration screen manages model downloads, deletion, retries, and runtime reinstallation.
To use an existing compatible binary, select its path in the configuration screen or set:
export OPENCODE_VOICE_WHISPER_BINARY="/path/to/whisper-cli"Set the API key before launching OpenCode:
export OPENAI_API_KEY="..."OpenCode Voice can also use an OpenCode-managed OpenAI key when OpenCode exposes that key through its provider API.
OAuth-only OpenAI connections cannot be used unless OpenCode also exposes a corresponding API key.
Set the API key before launching OpenCode:
export ELEVENLABS_API_KEY="..."ElevenLabs credentials are currently environment-variable only.
Note
OpenAI and ElevenLabs receive the recorded WAV file for transcription.
Handy uses its installed local models. Open OpenCode Voice: Config and select
an installed Handy model. If Handy is not on PATH, set Handy executable to
an absolute AppImage or GUI executable path; OpenCode Voice never downloads or
installs Handy.
Resolution order is OPENCODE_VOICE_HANDY_BINARY, the saved Handy executable,
handy on PATH, then standard platform locations. On Linux, either add Handy
to PATH or select an AppImage such as ~/.local/bin/Handy.AppImage or
~/Applications/Handy.AppImage in the configuration screen.
OpenCode Voice records mono 16 kHz WAV audio. It sends the complete recording to the selected transcription provider after recording stops; it does not insert interim text.
After transcription, the plugin trims the result and appends it to the active prompt. Existing prompt text and the transcript are separated by a blank line. Empty or silent transcriptions append nothing.
The WAV file is deleted after successful transcription or cancellation.
The plugin retries eligible transcription failures once. If the second attempt fails, it keeps the WAV file in:
~/.cache/opencode-voice/failed-recordings
Failed recordings do not expire automatically. Review or clear this directory periodically, or remove failed recordings from the configuration screen.
OpenCode Voice does not collect telemetry. Audio and transcript content are excluded from diagnostics.
Keep provider API keys in environment variables rather than repository or project configuration files.
Run OpenCode Voice: Config to change global user settings, including:
- Provider and transcription model
- Default or named microphone
- Maximum recording duration
- Microphone-level waveform
- Local Whisper models and runtime
- Custom
whisper-clipath - Handy executable path or auto-detection
- Failed-recording cleanup
Settings are global rather than project-specific.
Linux microphone discovery supports PulseAudio, PipeWire, and ALSA. A saved device that is no longer connected remains listed as unavailable until you select another device.
Install ffmpeg, pw-record, or arecord and make sure the command is available on your PATH.
On many Linux desktops, ffmpeg with PulseAudio support is the simplest option.
Reconnect the device or choose another microphone from OpenCode Voice: Config.
Default system microphone allows fallback between available recording backends. A named microphone does not.
Export the provider key before starting OpenCode:
export OPENAI_API_KEY="..."
# or
export ELEVENLABS_API_KEY="..."Do not place provider keys in the repository or project-level configuration.
Open OpenCode Voice: Config and reinstall the selected model or local runtime.
For a self-managed installation, set the path to a compatible whisper-cli:
export OPENCODE_VOICE_WHISPER_BINARY="/path/to/whisper-cli"The error message includes the retained WAV path. The recording remains available for recovery or manual transcription until you delete it.
- Release support is limited to Linux x64.
- Managed local transcription is CPU-only.
- Managed local models are English-only.
- The full microphone hardware matrix has not yet been tested.
- ElevenLabs requires
ELEVENLABS_API_KEY. - OAuth-only OpenAI credentials cannot be used without an exposed API key.
- Another plugin that replaces the same OpenCode prompt-footer slots may conflict with the recording UI.
- Failed recordings have no automatic age or size limit.
Most users do not need these variables:
| Variable | Purpose |
|---|---|
OPENCODE_VOICE_WHISPER_BINARY |
Use a custom whisper-cli binary |
OPENCODE_VOICE_HANDY_BINARY |
Use Handy before saved or auto-detected executable paths |
OPENCODE_VOICE_FAILED_RECORDINGS_DIR |
Change the failed-recording directory |
OPENCODE_VOICE_CAPTURE_COMMAND |
Override WAV capture; use {output} for the destination |
See docs/linux-smoke.md for the Linux capture matrix.
| Variable | Purpose |
|---|---|
OPENCODE_VOICE_RECORD_COMMAND |
Replace recording and transcription with a command that prints transcript text |
OPENCODE_VOICE_TRANSCRIPT |
Supply a fixed transcript |
npm ci
npm run build
npm run typecheck
npm testMaintainer documentation:
docs/public-api.md: package API compatibilitydocs/linux-smoke.md: Linux capture validationRELEASE-PLAN.md: release procedureSECURITY.md: private vulnerability reportingCHANGELOG.md: release history
