Voice dictation for pi. Press one shortcut, speak naturally, and insert the transcript into the editor without sending the prompt automatically.
Typing long prompts can slow you down. pi-voice-input lets you:
- capture ideas quickly while you are thinking out loud
- dictate long instructions, notes, bug reports, or code review comments
- speak naturally in Chinese, English, or a mix of both
- keep your hands on the keyboard with a simple toggle shortcut
- review or edit the inserted text before you submit it
- optionally polish dictated text with one of your configured pi models
- One-key dictation:
Ctrl+Shift+Rstarts recording; press it again to stop and insert text. - Editor-safe workflow: transcription is pasted into the current editor only. It does not auto-submit.
- Chinese/English mixed input: handles prompts that switch between Chinese, English, product names, and technical terms.
- Works on Linux and macOS: uses common system recording tools.
- Lowers sound while you speak: automatically turns down system audio during recording, then restores it afterwards.
- Optional transcript polish: use a pi model to clean up punctuation and wording before insertion.
- Simple setup commands: configure from inside pi with
/voice initand/voice key.
Current speech provider: VolcEngine Speech ASR. A VolcEngine Speech API key is required.
pi install npm:pi-voice-inputUpdate later with:
pi update npm:pi-voice-inputRestart pi after installing or updating.
-
Install the extension:
pi install npm:pi-voice-input
-
Restart pi.
-
Create the local config:
/voice init -
Add your VolcEngine Speech API key:
/voice keyGet your key here:
https://console.volcengine.com/speech/new/setting/apikeys?projectName=default
-
Check that pi sees your setup:
/voice config -
Press
Ctrl+Shift+R, speak, then pressCtrl+Shift+Ragain to insert the transcript.
Press:
Ctrl+Shift+R
Then speak naturally in Chinese, English, or both. Press Ctrl+Shift+R again to stop recording. The recognized text appears in the editor at your cursor.
Useful commands:
/voice start start recording
/voice stop stop, transcribe, and insert text
/voice toggle start or stop recording
/voice cancel stop and discard the recording
/voice status show current recorder state
/voice config show non-secret configuration
/voice key set or replace the API key
/voice help show setup help
By default, pi inserts the raw transcript. To let a pi model clean up punctuation and wording, set polishModel in:
~/.pi/agent/voice-input.config.json
Use any model name shown by:
pi --list-modelsExample:
{
"volcApiKey": "",
"polishModel": "your-model-name"
}If polishing fails, the raw transcript is inserted instead.
Linux needs one recording tool:
pw-recordfrom PipeWire tools, recommended- or
arecordfrom alsa-utils
macOS uses the built-in recorder when available. If recording does not work, install ffmpeg:
brew install ffmpegOn macOS, allow microphone access for your terminal or pi host app when prompted. You can also check System Settings → Privacy & Security → Microphone.
- Your API key is stored locally in
~/.pi/agent/voice-input.config.json. - Recordings are temporary and are removed after use.
- Transcribed text is inserted into the editor so you can review it before submitting.
- Run
/voice statusto see whether recording is active. - Run
/voice configto confirm the API key is detected. - Run
/voice keyagain if the key was changed or expired. - On macOS, check microphone permission if recording immediately fails.
- On Linux, make sure
pw-recordorarecordis installed and your microphone works in other apps.
See CONTRIBUTING.md for contribution guidelines.
See ROADMAP.md for planned user-visible work.
- API key settings: https://console.volcengine.com/speech/new/setting/apikeys?projectName=default
- VolcEngine ASR: https://www.volcengine.com/product/asr