Elegant dictation with press-and-hold recording powered by OpenAI's Whisper and GPT-4o-mini.
- 🎙️ Press & Hold Recording: Natural keyboard shortcut workflow
- 🗣️ Smart Transcription: Local Whisper or OpenAI API transcription
- 🤖 Intelligent Processing: GPT-4o-mini processes "note to the editor" commands
- ⌨️ Seamless Typing: Cross-platform text insertion
- ⚙️ Simple Setup: JSON-based configuration
- 🔄 Process-Based: Elegant inter-process communication
# Make sure Deno is installed
curl -fsSL https://deno.land/install.sh | sh
# Build and install
./build.shtypr config # Check current configurationAdd your OpenAI API key to ~/.typr-settings.json (auto-created on first run).
typr shortcutsFollow the instructions to bind a keyboard shortcut to typr toggle.
- Press your shortcut: Starts recording (you'll hear a beep)
- Release your shortcut: Stops, transcribes, and types the result
typr config- Show current configuration and statustypr shortcuts- Show keyboard shortcut setup instructionstypr record- One-time recording and transcriptiontypr toggle- Toggle recording (used by shortcuts)
- macOS: Built-in (uses AVFoundation)
- Linux:
ffmpegwith PulseAudio support - Windows:
ffmpegwith DirectShow support
- macOS: Built-in (uses AppleScript)
- Linux:
xdotoolpackage - Windows: Built-in (uses PowerShell)
pip install openai-whisperLinux (Ubuntu/Debian):
sudo apt update
sudo apt install ffmpeg xdotoolLinux (Arch/Manjaro):
sudo pacman -S ffmpeg xdotoolmacOS:
brew install ffmpegWindows:
# Install ffmpeg via chocolatey or download from https://ffmpeg.org/
choco install ffmpeg# After building
sudo mv ./dist/typr /usr/local/bin/
# or on Windows, add to PATHSettings are stored in ~/.typr-settings.json:
{
"openAIKey": "your-api-key",
"whisperPrompt": "Custom vocabulary context...",
"llmPrompt": "Custom processing instructions...",
"useLocalWhisper": false
}typr record
# Speak into microphone, press Enter to stop
# Text will be transcribed and optionally typedSay "note to the editor" followed by instructions during recording:
"Please write a professional email about the quarterly results. Note to the editor: make it formal and include bullet points."
The GPT model will process your transcription according to your custom LLM prompt.
typr start
# Press 'r' to record, 'q' to quitThe CLI version maintains all core functionality but with some changes:
✅ Preserved:
- OpenAI Whisper/GPT integration
- Local Whisper support
- Custom prompts and vocabulary
- Cross-platform text typing
- Same transcription quality
🔄 Changed:
- Process-based architecture instead of daemon mode
- Keyboard shortcut triggers process spawning
- Elegant signal-based inter-process communication
- Simplified setup with clear instructions
📦 Improved:
- No background processes or daemons
- Robust process coordination via PID files
- Natural press-and-hold workflow
- Better resource usage (only runs when needed)
The CLI is implemented in a single TypeScript file (typr.ts) using Deno:
# Run directly with Deno
deno run --allow-all typr.ts setup
# Build binary
deno compile --allow-all --output dist/typr typr.ts- Ensure ffmpeg is installed and in PATH
- Check microphone permissions
- Test with:
ffmpeg -f [format] -i [input] -t 5 test.wav
- Verify OpenAI API key is valid
- For local Whisper:
pip install openai-whisper - Check internet connection for API calls
- Linux: Install
xdotool - macOS: Grant accessibility permissions if prompted
- Windows: Run as administrator if needed
Same as original project.