{
  "markdown": "# Gemini CLI Voice Extension\n\n**Voice mode for [Gemini CLI](https://github.com/google-gemini/gemini-cli).** Talk to Gemini from your terminal, powered by the Gemini Live API.\n\n![Gemini CLI extension](docs/images/gemini-cli-extension.png)\n\nThis repo ships two things:\n\n- **`gemini-voice` CLI**, a standalone voice real-time transcription tool in the terminal with an audio waveform display. It captures speech from your microphone, streams it to the Gemini Live API, and returns a transcript.\n- **Gemini CLI Extension**, which adds a `/voice` command to Gemini CLI so you can speak instead of type.\n\nThe CLI was built first as the core transcription engine, and the extension wraps it to bring voice input into Gemini CLI. Think of it like voice mode for Claude Code, but for Gemini CLI.\n\n![gemini-voice CLI](docs/images/standalone-cli.png)\n\n### Current limitations\n\nThe extension approach works, but Gemini CLI's extension system has some constraints that limit the experience:\n\n- **No push-to-talk.** You need to type `/voice` (or use your OS voice-to-text) to start listening. There's no hotkey to hold and talk.\n- **No live feedback.** The standalone `gemini-voice` CLI shows a real-time audio waveform, but Gemini CLI doesn't support live output from extension subprocesses, so the interactive UI is suppressed when used as an extension.\n\nThese are platform limitations, not bugs. To get a true voice mode with push-to-talk, live waveforms, and tight integration, it needs to be built natively into Gemini CLI itself. I'm working on that, and this project is a stepping stone towards it, built on top of the Gemini Live API.\n\n## Features\n\n- Voice input for Gemini CLI via the `/voice` extension command\n- Native microphone capture via a Rust addon (cpal + lock-free ring buffer)\n- Real-time audio streaming to the Gemini Live API for transcription\n- Server-side voice activity detection (VAD), no local VAD needed\n- Automatic shutdown after speech ends\n- Ink-based terminal UI with spinner and live audio level meter (standalone CLI)\n- Standalone CLI with `transcribe` and `devices` subcommands\n- Pre-built native binaries, no Rust toolchain needed for end users\n\n## How it works\n\nThe Gemini Live API is actually a speech-to-speech API designed for real-time voice conversations with the model. We're repurposing it here, only using its real-time input transcription and server-side voice activity detection to build a transcription tool. The model's audio responses are ignored entirely.\n\n1. The native Rust addon captures 16kHz 16-bit PCM mono audio from the microphone using cpal\n2. Audio samples are written to a lock-free ring buffer and drained on a dedicated thread\n3. The drain thread pushes samples into Node.js via a NAPI ThreadsafeFunction (non-blocking)\n4. TypeScript code base64-encodes the PCM chunks and sends them as `realtimeInput` over a WebSocket to the Gemini Live API\n5. The server performs voice activity detection and streams back `inputTranscription` messages\n6. Once transcription is complete (or a settle timeout elapses), the transcript is printed to stdout and the process exits\n\n## Prerequisites\n\n- [Gemini CLI](https://github.com/google-gemini/gemini-cli)\n- [Node.js](https://nodejs.org/) (v18+)\n- A Gemini API key ([get one here](https://aistudio.google.com/apikey))\n\n## Installation\n\n### As a Gemini CLI extension\n\nFrom GitHub:\n\n```bash\ngemini extensions install https://github.com/kstonekuan/gemini-cli-voice-extension\n```\n\nFrom npm:\n\n```bash\ngemini extensions install @kstonekuan/gemini-voice\n```\n\nSet up your API key:\n\n```bash\ngemini-voice auth\n```\n\n### Standalone CLI\n\n```bash\nnpm install -g @kstonekuan/gemini-voice\ngemini-voice auth\n```\n\n### Development\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup.\n\n## Usage\n\n### Inside Gemini CLI\n\n```\n/voice\n```\n\n### Standalone CLI\n\n```bash\n# Transcribe speech from the default microphone\ngemini-voice transcribe\n\n# Transcribe from a specific audio device\ngemini-voice transcribe --device 1\n\n# Quiet mode -- only output the final transcript (no UI)\ngemini-voice transcribe --quiet\n\n# List available audio input devices\ngemini-voice devices\n```\n\n> **Note:** When using `/voice` inside Gemini CLI, the `--quiet` flag is used automatically. Gemini CLI's `!{...}` syntax does not support live output from subprocesses, so the interactive UI is suppressed. The model will echo back the transcription before responding.\n\nPress `Ctrl+C` to cancel at any time.\n",
  "bytes": 4451,
  "sha": "e839552377a3f777909a39312d54389569feda76d6101a98acc779c62e826ac5",
  "repo_slug": "kstonekuan/gemini-cli-voice-extension",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_kstonekuan_gemini_cli_voice_extension_688de33d/readme"
}