Skip to main content

Private voice-to-text for developers. Hold a key, speak, get text pasted into any app.

Project description

Voice Coding

Private voice-to-text for developers. Hold a hotkey, speak, get text pasted into any app.

  • Private — audio goes to Gemini Flash (your own API key), nowhere else
  • Fast — ~1 second transcription via Gemini 3.0 Flash
  • Universal — auto-pastes into any focused app: VS Code, Terminal, Slack, browser, etc.
  • Coding-aware — "dot env" → .env, "camel case foo bar" → fooBar

Install

pip install speakcode

Setup

  1. Get a Gemini API key
  2. Set your API key:
    export GEMINI_API_KEY=your_key_here
    
    Or create a ~/.voice-coding/.env file:
    GEMINI_API_KEY=your_key_here
    

macOS Permissions

Your terminal app (Terminal.app / iTerm / VS Code) needs two permissions in System Settings → Privacy & Security:

  • Microphone — for audio recording
  • Accessibility — for global hotkey detection and auto-paste keystroke simulation

After granting Accessibility, restart your terminal app for the permission to take effect.

Learn Project Vocabulary (Optional)

Teach Voice Coding the vocabulary of any project you work on:

cd /path/to/your/project
speak learn

This scans the repo (README, package.json, etc.) and merges its vocabulary into your global memory at ~/.voice-coding/memory.md. Run it in each repo you work on — terms accumulate across projects.

The memory file includes:

  • Vocabulary — project-specific terms with disambiguation hints (e.g., "Claude Code" not "clock code")
  • Context — brief descriptions of your projects and tech stacks
  • Notes — space for personal customizations (accent, language mixing, corrections you've noticed)

Edit ~/.voice-coding/memory.md anytime to add or fix terms.

Usage

speak

Hold Alt (⌥) to start recording. Release Alt to stop, transcribe, and auto-paste into whichever app is focused.

Press Ctrl+C to quit.

Tips

  • Speak naturally — filler words (um, uh, like, you know) are automatically removed
  • Minor grammar is corrected while preserving your original wording
  • Recordings shorter than 0.5 seconds are ignored to prevent accidental triggers

Coding Transforms

Voice Coding post-processes transcriptions with coding-aware rules:

You say You get
"dot env" .env
"slash api" /api
"camel case foo bar" fooBar
"snake case my variable" my_variable
"open paren" (
"arrow" =>
"triple equals" ===
"new line" newline character

How It Works

  1. A macOS CGEventTap listens for the Alt key globally (works in any app, including VS Code)
  2. sounddevice captures mic audio at 16kHz mono while the hotkey is held
  3. Audio is sent to Gemini 3.0 Flash for transcription, with vocabulary from ~/.voice-coding/memory.md if present
  4. Post-processor applies coding-aware text transforms
  5. Result is copied to clipboard via pbcopy and pasted via osascript Cmd+V simulation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

speakcode-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

speakcode-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file speakcode-0.1.0.tar.gz.

File metadata

  • Download URL: speakcode-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for speakcode-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ca4e5d2d904d215fb6f30790c697ccf26b9b0e1a0555932c0e414ea572696361
MD5 f3dc91732681af29c8e557d2f8fca7b3
BLAKE2b-256 6a270c53bc8862d7115ab7ee849d2929372e22a04c4a8c4e5703bfc3e2b93555

See more details on using hashes here.

File details

Details for the file speakcode-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: speakcode-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for speakcode-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fba4c13ad2aec56404ab7e6e7408e421d5df03b06951aed643c647e097aafcfb
MD5 cd347f3a1cbee62f8c2ee5da51b062b9
BLAKE2b-256 8cadee8991101ad6bfa08a15aa0df437d552820d281c83f9ee55e1e1849eef78

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page