English | 简体中文
agent-voice-input
Context-aware voice input for CLI coding agents—grounded in your live session, repo, and SSH hosts.
Supports macOS and Windows + WSL2. Built for Codex, Claude Code, and Antigravity CLI (agy), while working out of the box across desktop IDEs and everyday apps.
🎙️ What you say casually to your terminal:
"Uh check the default retry timeout in session router dot py, change it from
five seconds to ten seconds—actually wait, make it fifteen seconds—and run
the unit tests without piping to head"
❌ Generic OS dictation:
Uh check the default retry timeout in session router dot pie change it from 5 seconds to 10 seconds actually wait make it 15 seconds and run the unit tests without piping to head
✅ agent-voice-input (grounded in active Agent session & repo, pasted without Enter):
Check the default of retry_timeout_sec in session_router.py, change it to 15 seconds, and run the unit tests without piping to head.
- Grounded in Your Active Context: Automatically reads the focused terminal, Ghostty split,
tmuxpane, desktop IDE workspace, or whitelisted SSH host—fixing filenames, symbols, and mid-sentence self-corrections with 50K block prefix caching. - Anti-Crosstalk & Paste-Only Safety: Locks onto the origin window on record start, injects directly without touching your clipboard in macOS Ghostty/
tmux(snapshot & restore elsewhere), falls back to clipboard if focus drifts, and never auto-presses Enter. - Lightweight Pure Standard Library: Zero third-party Python dependencies (pure Python
>= 3.10+ hostffmpeg+ thin native shims, no Electron), with local silence gating, long-pause compression, andretryrecovery for failed clips. - 100% Non-Interactive CLI: Zero
y/nprompts and structured--jsondiagnostics, designed for both humans and coding agents.
Quick Start
Option A: Let Your Coding Agent Install & Configure It (Recommended)
Paste this single sentence into Claude Code, Codex, Antigravity (agy), or Cursor:
Follow https://github.com/xiaohuaxi/agent-voice-input/blob/main/docs/agent-setup.md to install and configure agent-voice-input on this machine (check ffmpeg/uv as needed), then walk me through my first voice dictation test.
Option B: Manual Setup
1. Install (handles Python >= 3.10 and PEP 668 automatically via uv; no sudo, no shell rc edits):
(tmp=$(mktemp) && trap 'rm -f "$tmp"' EXIT && curl -fsSL https://raw.githubusercontent.com/xiaohuaxi/agent-voice-input/main/install.sh -o "$tmp" && sh "$tmp")
(Already have uv? Run uv tool install --python '>=3.10' agent-voice-input directly. Need ffmpeg? macOS: brew install ffmpeg + xcode-select --install; WSL2: sudo apt update && sudo apt install -y ffmpeg.)
Zero-dependency install from git clone (Python >= 3.10 already installed)
git clone https://github.com/xiaohuaxi/agent-voice-input.git && mkdir -p ~/.local/bin
ln -s "$PWD/agent-voice-input/bin/agent-voice-input" ~/.local/bin/agent-voice-input
2. Initialize, add 1 API key & start (remember to remove the leading # when editing .env):
# 1) Create ~/.agent-voice-input/ (config.toml, .env, starter hotwords/personal.txt)
agent-voice-input init
# 2) Uncomment and add 1 ASR key in ~/.agent-voice-input/.env
# Mainland China: DASHSCOPE_API_KEY or DEEPSEEK_API_KEY
# Global: OPENROUTER_API_KEY, OPENAI_API_KEY, or GEMINI_API_KEY
# (Existing local `codex` ChatGPT subscription login is auto-reused first by `auto`,
# never Fast; to pin Codex including API-key mode, set `refiner.provider = "codex"`.)
# 3) Verify connectivity & start daemon (first run compiles native shim)
agent-voice-input doctor --ping && agent-voice-input start
- Default hotkeys: MacBook built-in keyboards auto-default to Right Command (
RCommand); desktop Macs (e.g., Mac mini) and Windows/WSL2 default to Right Ctrl (RControl). Tap<= 0.5sto start/stop; hold0.8sto cancel. - macOS note: Always run
agent-voice-input startfrom your local GUI terminal (not over SSH orlaunchd), and grant Microphone (+ Automation/Accessibility as prompted) to that terminal.
Supported Setups & 1-Key Recipes
- Zero hooks needed for ~80% of workflows: macOS Ghostty (
✅),Terminal.app(🧪),iTerm2(🧪), local/remotetmux(✅), Antigravity 2.0 / ChatGPT Codex / Claude Desktop (✅macOS), desktop IDEs (🧪), WSL2 single/distinct-dir windows (✅), and any everyday app (⚪) work out of the box. See the full Compatibility Matrix & User Guide.
| Scenario | Stage 1 (ASR) | Stage 2 (Refiner) | Key / Login Needed |
|---|---|---|---|
| Reuse Codex / AGY Login (Best Quality) | dashscope, openrouter, doubao, openai, or deepseek |
codex (auto prefers ChatGPT subscription login first, never Fast; set refiner.provider = "codex" to pin, including API-key mode) or agy (opt-in) |
1 Stage 1 key + local codex / agy login |
| Mainland China (CN / Mixed CN–EN) | dashscope (qwen3-asr-flash, 150 terms / 1,800 chars) or doubao (bigmodel, 50 / 1,000) |
codex / agy / openrouter (or budget deepseek / dashscope) |
DASHSCOPE_API_KEY, or DOUBAO_SPEECH_API_KEY (Stage 2 refinement needs another LLM key or local codex/agy login) |
| Global 1-Key (High Quality Two-Stage) | openrouter (microsoft/mai-transcribe-2, ~$0.10/hr) or openai (gpt-transcribe) |
openrouter (google/gemini-3.8-flash) or openai (gpt-6-luna) |
OPENROUTER_API_KEY or OPENAI_API_KEY |
| Minimal 1-Key Budget / Single-Hop | deepseek (two-stage), dashscope (two-stage or qwen3.8-omni-flash), or gemini (single-hop) |
Built-in default or skipped in single-hop | DEEPSEEK_API_KEY, DASHSCOPE_API_KEY, or GEMINI_API_KEY |
Full 13-provider table, auto routing rules, and config.toml recipes: Providers & Models Guide.
Privacy & Data-Flow Commitments
- No Author Servers, Zero Middleman: No author-hosted servers, relays, or hidden telemetry. Audio and context go directly from your machine to the provider you explicitly configure (Apache-2.0 open source).
- No Audio or Transcripts Stored by Default: Status snapshots, logs, and
diag.jsonlredact secrets and never write speech transcripts, session context, or hotwords. Failed/cancelled-in-flight clips stash (0600, 24h TTL, max 10) infailed/forretry. Optional[archive](save_transcripts14-field JSONL withagent/agent_session_id,save_audioMP3) is off by default,0700/0600, and gitignored. 0700/0600Isolation & No Invasive Scraping: Reads only focused window metadata, plain-text CLI agent logs, and read-only AGY/Codex/Claude local session indexes—never VS Code/Cursorstate.vscdbor chat/browser DOM trees. SSH probing queries only explicitly whitelisted hosts with zero remote keys.- Scoped Context Only & Transparent
auto: Coding mode sends only recent active dialogue andgit status/shallow filenames—never your full repo. Defaultprovider = "auto"checks env/.envkeys and prefers localcodexChatGPT subscription login first for Stage 2 (agyis opt-in only); to pin Codex (including API-key mode) or another provider, set explicit providers (e.g.,refiner.provider = "codex"or"off").
Daily CLI Cheatsheet
agent-voice-input init [--asr P] [--refiner P] [--hotkey K] # Initialize ~/.agent-voice-input/
agent-voice-input start | restart | stop # Manage background daemon
agent-voice-input status [--history N] [--json] # Health, active pipeline, archive & hotwords
agent-voice-input doctor [--ping] [--remote] [--json] # Audio, shim, credentials, hooks & live ping
agent-voice-input diagnose [--last N] [--json] # Latency p50, cache hits & redacted log tail
agent-voice-input retry --list # List stashed clips (safe recover: retry 1 --dry-run)
agent-voice-input hotwords list|add|remove|path # Manage personal.txt (!pin & <- aliases)
agent-voice-input once --duration 4 --dry-run # Test capture & refinement without pasting
agent-voice-input integrate [--status] [--dry-run] [--json] # Optional multi-window CLI hooks
agent-voice-input key-test # Inspect raw key scancodes / modifiers
- Personal hotwords: Edit
~/.agent-voice-input/hotwords/personal.txt(or runagent-voice-input hotwords add Term --pin --alias ...) to pin project names and fix recurring mishearings; hot-reloads on the next utterance. - Upgrade / Uninstall: Upgrade via
uv tool upgrade agent-voice-input && agent-voice-input restart(or re-runinstall.sh); uninstall viaagent-voice-input stop && uv tool uninstall agent-voice-input. - Terminal auto-start (never use macOS
launchd): Add[ -z "$SSH_CONNECTION" ] && command -v agent-voice-input >/dev/null 2>&1 && agent-voice-input start >/dev/null 2>&1to~/.zshrcor~/.bashrc.
Documentation
- AI Agent Setup & Troubleshooting Contract — deterministic setup guide for Coding Agents
- Providers, Models &
config.tomlRecipes — all 13 providers, two-stage vs. single-hop, auto-routing - User Guide, Compatibility Matrix, Hotwords & FAQ — macOS TCC, WSL2 WASAPI, hotwords, 14-field archiving, CLI flags, PEP 668 & proxy FAQ
- Optional Multi-Window Hooks & SSH Remote Setup · Context Routing Architecture (zh-CN)
- Templates:
config.example.toml·config.example.env·install.sh
Security, Acknowledgments & License
- Security: See SECURITY.md for vulnerability reporting and security boundaries.
- Acknowledgments: Early exploration was inspired by
Einstellung/voice-asr(pairingQwen3-ASRwith technical terminology context, silence gating, and loudness normalization). - License: Apache-2.0 License
- Offline tests (source checkout):
PYTHONPATH=src python3 -m unittest discover -s tests -v
Metadata
Release files for agent-voice-input 0.19.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_voice_input-0.19.0.tar.gz | 1.6 MB | With provenance | Details for agent_voice_input-0.19.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_voice_input-0.19.0-py3-none-any.whl | Python 3 | none | any | Details for agent_voice_input-0.19.0-py3-none-any.whl |
Total release size: 2.2 MB
Release files / agent_voice_input-0.19.0.tar.gz
| Download URL | agent_voice_input-0.19.0.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f07a67dc10a9451215f8afe0a41e584a70d18086d740937a032c33eec3dd8d9
|
|
BLAKE2b-256 checksum How to use checksums |
5ec47a0f4ffe4bbb2bd078da46b544d194be871b8e8a66e5d5f9d6c54a262667
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / agent_voice_input-0.19.0-py3-none-any.whl
| Download URL | agent_voice_input-0.19.0-py3-none-any.whl |
|---|---|
| Size | 635.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7bf7563f4733bfdfbe49bcf70d805d11a1de3708891340c77efa7f4626c043e
|
|
BLAKE2b-256 checksum How to use checksums |
07ecf8ac2b047576498cb2a9b9f259b6a470afd51f5b78e4510b377b29805364
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for agent-voice-input 0.19.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agent_voice_input-0.19.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.