{
  "markdown": "# gemini-stts\n\nA Gemini CLI extension that adds speech-to-text (STT) and text-to-speech (TTS) capabilities to the Gemini CLI. Speak your prompts instead of typing them, and hear Gemini CLI's responses read aloud.\n\nIf you are looking for claude code alternative... [claude-stts](https://github.com/sandipchitale/claude-stts)\n\n![Works with both - claude code and gemini cli](screenshots/cc-gc-stts.png)\n\n## Features\n\n- **Speech-to-Text (`/t`)** - Dictate your prompt using your microphone via a Chrome-based UI powered by the Web SpeechRecognition API\n- **Text-to-Speech (`/h`)** - Have Gemini CLI's response (or any text) spoken aloud using the browser's SpeechSynthesis API\n- **Combined STT + TTS (`/th`)** - Speak your prompt and automatically hear the response -- a full voice conversation flow\n- **Looping STT (`/tl`)** - Like `/t`, but keeps re-opening the dictation dialog after each prompt until you cancel it\n- **Looping STT + TTS (`/thl`)** - Like `/th`, but stays in a continuous speak-and-listen loop until you cancel the dialog\n\n### Voice Commands (STT)\n\nWhile dictating, you can use voice commands for hands-free editing:\n\n| Command | Action |\n|---|---|\n| `insert comma / period / question mark / exclamation mark / tab` | Inserts the corresponding punctuation or character |\n| `new paragraph` | Ends the current sentence and starts a new paragraph |\n| `go to start / go to end` | Moves cursor to the beginning or end of the text |\n| `select all` | Selects all text |\n| `unselect selection` | Collapses the selection without deleting |\n| `delete selection` | Deletes the selected text |\n| `undo it / redo it` | Undo or redo the last action |\n\nA built-in cheat sheet for these voice commands is also available via the 🗣️ button in the STT dialog.\n\n### Keyboard Shortcuts (STT)\n\n| Shortcut | Action |\n|---|---|\n| `Ctrl+R` | Toggle speech recognition on/off |\n| `Enter` | Send the prompt |\n| `Shift+Enter` | Insert a new line |\n| `Escape` | Stop recording / cancel |\n\n## How It Works\n\nThe plugin launches a Chrome instance (via [chrome-launcher](https://www.npmjs.com/package/chrome-launcher)) in app mode and connects to it using [puppeteer-core](https://www.npmjs.com/package/puppeteer-core). This approach leverages the browser's native `SpeechRecognition` and `SpeechSynthesis` APIs, which provide high-quality speech processing without requiring any external API keys or services.\n\n- **STT flow**: Opens a Chrome window with a textarea where you can type or dictate. Microphone permission is automatically granted via Puppeteer. When you click \"Send\" or press Enter, the text is printed to stdout, which Gemini CLI captures and processes as your prompt.\n\n![Speak](screenshots/stt.png)\n\n- **TTS flow**: Opens a Chrome window that receives text via Puppeteer's `evaluateOnNewDocument`, then speaks it using `SpeechSynthesisUtterance`. Supports a `--oneshot` flag to automatically close after speaking.\n\n![Hear](screenshots/tts.png)\n\n## Architecture\n\n```\ngemini-stts/\n├── commands/\n│   ├── t.toml                 # /t command - speech-to-text\n│   ├── tl.toml                # /tl command - looping speech-to-text\n│   ├── h.toml                 # /h command - text-to-speech\n│   ├── th.toml                # /th command - combined STT + TTS\n│   └── thl.toml               # /thl command - looping STT + TTS\n├── src/\n│   ├── chrome-sidekick.ts   # Chrome launcher and Puppeteer connection utilities\n│   ├── stt.ts               # STT entry point - launches Chrome with speech recognition UI\n│   ├── stt_ui.html          # STT frontend - textarea with SpeechRecognition integration\n│   ├── tts.ts               # TTS entry point - launches Chrome with speech synthesis UI\n│   └── tts_ui.html          # TTS frontend - textarea with SpeechSynthesis integration\n├── dist/                    # Pre-built bundles (committed so users don't need `npm install`)\n│   ├── stt.mjs              # Bundled STT entry point\n│   ├── tts.mjs              # Bundled TTS entry point\n│   ├── stt_ui.html          # Copied at build time\n│   └── tts_ui.html          # Copied at build time\n├── build.mjs                # esbuild build script\n├── gemini-extension.json    # Gemini CLI extension manifest\n├── package.json\n└── tsconfig.json\n```\n\n## Prerequisites\n\n- **Node.js** (v18+)\n- **Google Chrome** or Chromium installed on your system\n- A working **microphone** for speech-to-text\n\n## Installation\n\n### As a Gemini CLI Extension\n\nInstall directly from the repository:\n\n```bash\ngemini extension link .\n```\n\nThe repository ships with pre-built bundles in `dist/`, so **no `npm install` is required** for end users. The slash commands invoke `node ${extensionPath}/dist/stt.mjs` and `dist/tts.mjs` directly.\n\n### For Local Development\n\n```bash\ngit clone https://github.com/sandipchitale/gemini-stts.git\ncd gemini-stts\nnpm install\nnpm run build   # bundles src/*.ts into dist/ via esbuild\n```\n\nThen add it as a local marketplace and plugin in Gemini CLI:\n\n```bash\ngit clone https://github.com/sandipchitale/gemini-stts.git\ncd gemini-stts\ngemini extension link .\n```\n\nThe build script (`build.mjs`) uses [esbuild](https://esbuild.github.io/) to bundle `src/stt.ts` and `src/tts.ts` into standalone ESM files under `dist/`, and copies the HTML UI assets alongside them. Re-run `npm run build` after any change in `src/`.\n\n## Usage\n\nOnce installed, use the slash commands in Gemini CLI:\n\n```\n/t [initial text]   # Speak your prompt\n/tl                 # Speak your prompt in a loop until cancelled\n/h                  # Hear Gemini CLI's last response\n/h prompt text      # Hear specific text spoken aloud\n/th [initial text]  # Speak your prompt and hear the response\n/thl [initial text] # Speak-and-hear in a loop until cancelled\n```\n\nAll slash commands accept optional text arguments that pre-populate the dictation textarea, e.g.:\n\n```\n/t Write a haiku about\n/h The quick brown fox jumps over the lazy dog\n```\n\n## Dependencies\n\n- [chrome-launcher](https://www.npmjs.com/package/chrome-launcher) - Launches Chrome with custom flags\n- [puppeteer-core](https://www.npmjs.com/package/puppeteer-core) - Connects to and controls the Chrome instance\n- [commander](https://www.npmjs.com/package/commander) - CLI argument parsing\n- [esbuild](https://esbuild.github.io/) (dev) - Bundles `src/*.ts` into `dist/*.mjs` so the plugin runs without `npm install`\n\n## License\n\nMIT\n\n## Author\n\nSandip Chitale\n",
  "bytes": 6379,
  "sha": "58912d175f8614cf9d66a874bdcf110e288f1279ffb64003c92e4834f2857554",
  "repo_slug": "sandipchitale/gemini-stts",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_sandipchitale_gemini_stts_82d1d174/readme"
}