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 speakandcode

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
voice 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

voice

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

speakandcode-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.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: speakandcode-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 speakandcode-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4abec35aa841a45c5bb9d343a3c1b3618d55008ebf02372f4b806c61c7291332
MD5 406e0f752d412957130abe4fb124f229
BLAKE2b-256 f853d27006dbe91570ae0670f899c90144f00ddc969e56cc2ccaa15d684e6c24

See more details on using hashes here.

File details

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

File metadata

  • Download URL: speakandcode-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 speakandcode-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aea0eab1f3dc81a8fef04d893f8f249a2307e41285f8dfecb7b09fe50aa1d366
MD5 9633b6cc4f8ed47310644a63ec675d8e
BLAKE2b-256 0fe0541595668d771ea68f98bc85bca9fa834b017fe80fa920837ff2e525d3cf

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