@loyslow/opencode-voice-groqGroq voice input plugin for OpenCode
0
204
近 7 天 166
32.4
生态多维模型
1 个月前
2026-07-12
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@loyslow/opencode-voice-groq@0.1.2"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@loyslow/opencode-voice-groq@0.1.2"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D @loyslow/opencode-voice-groqopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Cloud-based, ultra-fast speech-to-text for the OpenCode TUI.
English | Русский | 简体中文 | Español
This is a fork of the original opencode-voice. Instead of downloading heavy models and processing audio locally (which consumes CPU/GPU and takes time), this plugin uses Groq's LPU inference engine. Audio is recorded, aggressively compressed to m4a (AAC) on-the-fly, stripped of silence, and transcribed in milliseconds.
Installation
One command through OpenCode:
opencode plugin @loyslow/opencode-voice-groq
Restart OpenCode after installing. First launch will ask for a Groq API key to use their ultra-fast LPU inference engine. The plugin uses ffmpeg automatically.
Optional CLI installer. It runs the same OpenCode plugin install command:
npx @loyslow/opencode-voice-groq install
Do not clone the repo unless you want to develop the plugin.
[!TIP] First launch opens a setup prompt. Enter your free Groq API key, choose your preferred Whisper model, then use
ctrl+rto dictate into the prompt.
Requirements
The plugin relies on Groq's API and requires a recording engine:
- uses
ffmpegfrom your system, or downloads a managedffmpeg-staticfallback - saves compressed
m4arecordings to~/.cache/opencode-voice-groq/recordings/temporarily - uses your provided
groqApiKeyfor transcription
Get your free API key at Groq Console.
Usage
Commands:
/voice- toggle recording and append transcription/voice-submit- toggle recording, append transcription, and submit/voice-stop- cancel active recording or transcription/voice-settings- open model, hotkeys, microphone, and Groq quotas settings
Default hotkey:
ctrl+r -> start recording
ctrl+r -> stop, transcribe, and append
You can configure a cancel hotkey in /voice-settings.
Models
Available now through Groq API:
| Model | Inference Speed | Notes |
|---|---|---|
| Whisper Large v3 | Ultra-fast | highly accurate, multilingual |
| Whisper Large v3 Turbo | Insanely fast | slightly faster, great accuracy |
The plugin enforces local RPM tracking (Fail-Fast Quota Protection) to prevent you from recording if you've hit your free API limits, saving you time. Audio is compressed to m4a with silence removal to optimize bandwidth.
Platform Status
| Platform | Status |
|---|---|
| Linux | one-command install; recording uses arecord, ffmpeg, or sox |
| macOS | one-command install; recording uses ffmpeg AVFoundation |
| Windows | one-command install; recording uses DirectShow through a managed cached ffmpeg.exe, with system/bundled ffmpeg fallback |
Architecture
The package follows the public OpenCode TUI plugin shape used by community plugins.
- npm package exports
./tui - local development can point
tui.jsonat an absolute path - published install uses
opencode plugin @loyslow/opencode-voice-groq - runtime settings live in OpenCode TUI plugin storage
Files:
index.js- TUI plugin entrypoint, commands, dialogs, keymap layer, auto-updaterlib/download.js- utility for fetching the fallback recorderlib/engine.js- recorder selection, managed Windows recorder install, and Groq APIfetchimplementationbin/cli.js- install wrapper CLI
Voice input needs native audio recording. The JS plugin manages OpenCode UI, settings, engine downloads, and fast API integration.
Roadmap
- Faster streaming-style transcription via WebSockets
- Further audio compression tuning
Development
Run checks:
npm run prepack
npm pack --dry-run
This MVP has no build step.
Development install from a checkout:
git clone https://github.com/loyslow-dev/opencode-voice-groq.git opencode-voice-groq
cd opencode-voice-groq
opencode plugin "$(pwd)"
Project Status
This is an independent OpenCode plugin. It is not built by the OpenCode team and is not affiliated with OpenCode.
Credits
- OpenCode wordmark SVG adapted from the public OpenCode repository. The
voicemark was added for this plugin. - This is a fork of the original opencode-voice project created by
@ihxnnxs.