Voice assistant for OpenClaw - press a hotkey, speak, get AI response.
- π€ Global hotkey (
Cmd+Shift+Space) to start voice recording - π£οΈ Local Whisper transcription (no API calls, free)
- π€ OpenClaw integration - sends transcription to your local OpenClaw instance
- π Audio response - speaks the answer back using TTS
- πΊπ¦ Ukrainian language support - native Ukrainian TTS voice (Lada)
- Press and hold
Cmd+Shift+Spaceβ recording starts - Speak your question while holding
- Release hotkey β recording stops, Whisper transcribes locally
- Text sent to OpenClaw via WebSocket (direct gateway connection)
- Agent processes request and returns response
- Response is spoken aloud via TTS (macOS
sayor Piper) - Response is also delivered to your Telegram chat
- macOS 12.0+
- Python 3.9+
- OpenClaw running locally
- Homebrew (for dependencies)
- Accessibility permissions (for hotkey detection) - see PERMISSIONS.md
Everything installs locally in the project - no global pollution:
# Clone the repo
git clone https://github.com/franzus5/openclaw-voice-hotkey.git
cd openclaw-voice-hotkey
# Run local setup
chmod +x setup_local.sh
./setup_local.sh
# Run the assistant
./run.shThis creates:
openclaw-voice-hotkey/
βββ venv/ β Python packages (local virtualenv)
βββ models/
β βββ whisper/ β Whisper models (~74MB)
β βββ tts/ β TTS voice models
βββ bin/ β Piper binary
No global installation! Everything is self-contained.
# Clone the repo
git clone https://github.com/franzus5/openclaw-voice-hotkey.git
cd openclaw-voice-hotkey
# Run global setup
chmod +x setup.sh
./setup.sh
# Run the assistant
python3 voice_hotkey.pyThis installs:
- Python packages globally
- Whisper models in
~/.cache/whisper/ - Piper TTS locally in project
If you prefer manual setup:
# Install system dependencies
brew install portaudio ffmpeg
# Create venv
python3 -m venv venv
source venv/bin/activate
# Install packages
pip install -r requirements.txt
# Run
python3 voice_hotkey.pyEdit config.json:
{
"hotkey": "cmd+shift+space",
"whisperModel": "base",
"ttsEngine": "say",
"language": "uk",
"inputDevice": null,
"telegramUserId": "YOUR_TELEGRAM_USER_ID",
"gatewayUrl": "ws://127.0.0.1:18789",
"gatewayToken": null,
"piperBinary": "./bin/piper",
"piperModelUK": "./models/tts/uk_UA-lada-x_low.onnx",
"piperModelEN": "./models/tts/en_US-lessac-medium.onnx"
}Options:
hotkey: Keyboard shortcut (default:cmd+shift+space)whisperModel: Whisper model size (tiny,base,small,medium,large)tiny: fastest, lowest quality (~39MB)base: good balance (~74MB) - recommendedsmall: better quality (~244MB)medium: high quality (~769MB)large: best quality (~1.5GB)
ttsEngine: Text-to-speech enginesay: macOS built-in (fast, decent quality)piper: Local TTS (better quality, more natural, supports Ukrainian)sag: ElevenLabs via skill (requires API key, cloud-based)
language: Language for Piper TTS (ukoren)uk: Ukrainian voice (Lada) - defaulten: English voice (Lessac)
inputDevice: Audio input device index (see device list on startup)null: use system default2: use device #2 (e.g., headset microphone)- Check device list when starting the assistant
telegramUserId: Your Telegram user ID (for session routing)- Find it by sending
/startto@userinfoboton Telegram - Optional but recommended for proper session management
- Find it by sending
gatewayUrl: OpenClaw Gateway WebSocket URL- Default:
ws://127.0.0.1:18789 - Change if your gateway runs on different host/port
- Default:
gatewayToken: Gateway authentication token (optional)- Set to
nullfor local development (no auth) - Required if your gateway has
OPENCLAW_GATEWAY_TOKENset
- Set to
piperModelUK: Path to Ukrainian voice modelpiperModelEN: Path to English voice model
- Start the assistant:
python3 voice_hotkey.py - Press and hold
Cmd+Shift+Space - Speak your question
- Release the hotkey
- Wait for transcription + AI response
βββββββββββββββ
β Hotkey β Cmd+Shift+Space
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Record β pyaudio β audio.wav
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Whisper β whisper audio.wav β text
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β OpenClaw β ws://127.0.0.1:18789
β Gateway β send(text) β response
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β TTS β piper/say β speech
βββββββββββββββ
openclaw-voice-hotkey/
βββ voice_hotkey.py # Main application
βββ config.json # Configuration
βββ requirements.txt # Python dependencies
βββ setup_local.sh # Local setup (recommended)
βββ setup.sh # Global setup
βββ run.sh # Run with local env
βββ test_components.py # Component tests
β
βββ venv/ # Python virtualenv (local)
β βββ lib/ # Python packages
β
βββ models/ # AI models (local)
β βββ whisper/ # Speech recognition
β β βββ base.pt # ~74MB
β βββ tts/ # Text-to-speech
β βββ uk_UA-lada-x_low.onnx # Ukrainian
β βββ en_US-lessac-medium.onnx # English
β
βββ bin/ # Binaries (local)
βββ piper # TTS engine
You need to grant Accessibility permissions to Terminal.
π See PERMISSIONS.md for detailed instructions
Quick fix:
- System Settings β Privacy & Security β Accessibility
- Add Terminal.app
- Restart the assistant
- Check Accessibility permissions (see above)
- Make sure you press Cmd+Shift+Space (all three keys)
- Try restarting Terminal completely
- Check microphone permissions (System Settings β Privacy & Security β Microphone)
- Speak clearly and hold hotkey while speaking
- Recording duration must be > 0.5 seconds
- Try testing microphone:
rec test.wav trim 0 3 && play test.wav
- Make sure OpenClaw is running:
openclaw status - Check you're in the main session (Telegram/etc)
- Message is sent via
openclaw injectcommand
- Create repo structure
- Implement hotkey listener (pynput)
- Implement audio recording (pyaudio)
- Whisper CLI integration
- Local TTS (Piper) with Ukrainian support
- Self-contained setup (like node_modules)
- OpenClaw WebSocket client (in progress)
- Proper Cmd+Shift+Space detection (done, needs testing)
- Menu bar app (optional)
- Standalone .app bundle (no Terminal required)
MIT