Skip to content

Repository files navigation

opencode-voice

Voice control for OpenCode

Everything runs on your machine — no cloud services, no API keys, no audio leaves your device.

Microphone → whisper.cpp → text → OpenCode

Install

cargo install opencode-voice

Requires Rust 1.70+, cmake, and a C compiler. See Building from source for details.

Setup

Download a transcription model (~150 MB):

opencode-voice setup

Run

Start OpenCode with its HTTP server, then start opencode-voice in a separate terminal:

opencode --port 4096
opencode-voice --port 4096

Hold space to record, release to transcribe and send. Press q to quit.


Options

FlagDefaultDescription
--port <n>(required)OpenCode server port
--model <size>base.enWhisper model (see below)
--device <name>system defaultAudio input device
--key <name>spaceToggle key for recording
--hotkey <name>right_optionGlobal hotkey (system-wide)
--no-globalDisable global hotkey
--no-push-to-talkToggle mode instead of hold-to-talk
--no-auto-submitDon't auto-submit; leave transcript in prompt for review
--no-handle-promptsDon't handle OpenCode permission/question prompts via voice

Models

English-only models are fine-tuned on English and generally more accurate. Multilingual models support 99 languages and may help with some accents, but the biggest improvement for accent robustness comes from using a larger model size.

ModelTypeSize
tiny.enEnglish-only~75 MB
base.enEnglish-only (default)~142 MB
small.enEnglish-only~466 MB
tinyMultilingual~75 MB
baseMultilingual~142 MB
smallMultilingual~466 MB

Environment variables: OPENCODE_VOICE_PORT, OPENCODE_VOICE_MODEL, OPENCODE_SERVER_PASSWORD.

Other commands

opencode-voice setup [--model <MODEL>] Download whisper model
opencode-voice devices List audio input devices
opencode-voice keys List key names for --key / --hotkey

Troubleshooting

ProblemFix
Can't connect to OpenCodeMake sure OpenCode is running with --port
No speech detectedSpeak closer to mic, try --model small.en, check opencode-voice devices
Whisper model not foundRun opencode-voice setup
Global hotkeys don't work (macOS)Grant Accessibility permission in System Settings, or use --no-global
Auth errors (401)Set OPENCODE_SERVER_PASSWORD env var
Build failuresSee Building from source

Platform support

PlatformStatus
macOSFully supported (requires Accessibility permission for global hotkeys)
LinuxSupported (ALSA or PulseAudio)
WindowsNot supported

License

Apache 2.0 — see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages