talk-tts
v0.1.1
Published
Multilingual text-to-speech CLI powered by Kokoro
Maintainers
Readme
talk-cli
talk-cli is a fast, offline-capable multilingual text-to-speech CLI powered by Kokoro. It auto-detects language, supports 150+ voices, and uses the faster MLX backend automatically on Apple Silicon.
talk "Hello, world!"
talk "你好,欢迎使用 talk-cli"
talk -v af_sky -s 1.2 "Speed it up a bit"
talk --output hello.wav "Save to file"Features
- Auto language detection — switches between English and Chinese based on text content
- 150+ voices — 54 English voices (American, British, Spanish, French, Hindi, Japanese, Portuguese, Italian) and 103 Chinese voices
- Apple Silicon optimised — uses MLX backend for English on M-series Macs, falls back to ONNX automatically
- Offline after first use — engine and models are cached in
~/.cache/talk-cli/ - Save to file — export speech as WAV with
--output - Tiny binary — ~8 MB Go binary; engine and models are downloaded on demand
Supported Platforms
| Platform | Architecture | Backend | |----------|-------------|---------| | macOS | Apple Silicon (arm64) | MLX (fast) + ONNX fallback | | macOS | Intel (amd64) | ONNX | | Windows | amd64 | ONNX | | Linux | — | Export to file only (no audio playback) |
Installation
npm (Node.js 18+)
npm install -g talk-ttsOne-line install
macOS:
curl -fsSL https://raw.githubusercontent.com/hoveychen/talk-cli/main/install.sh | bashWindows (PowerShell):
powershell -c "irm https://raw.githubusercontent.com/hoveychen/talk-cli/main/install.ps1 | iex"Auto-detects your platform and architecture, installs to ~/.local/bin (macOS) or %LOCALAPPDATA%\talk-cli\bin (Windows), and adds it to your PATH automatically.
To install a specific version or change the install directory:
# macOS
TALK_VERSION=v0.2.0 TALK_INSTALL_DIR=/usr/local/bin curl -fsSL https://raw.githubusercontent.com/hoveychen/talk-cli/main/install.sh | bash
# Windows
$env:TALK_VERSION="v0.2.0"; $env:TALK_INSTALL_DIR="C:\Tools"; powershell -c "irm https://raw.githubusercontent.com/hoveychen/talk-cli/main/install.ps1 | iex"Build from source
Requires Go 1.22+.
git clone https://github.com/hoveychen/talk-cli.git
cd talk-cli
make build # outputs to bin/Usage
Speak text
talk "Hello, world!" # English (auto-detected)
talk "你好,欢迎使用 talk-cli" # Chinese (auto-detected)
talk --lang zh "Kokoro is great" # Force language
talk -v af_sky "Choose a specific voice" # Choose voice
talk -s 1.5 "Speak 50% faster" # Adjust speed (0.5–2.0)
talk -o out.wav "Save as WAV" # Export to fileList voices
talk voices # All voices
talk voices --lang en # English only
talk voices --lang zh # Chinese onlyPre-download assets (for offline use)
talk init # Download both English and Chinese
talk init --lang en # English only
talk init --lang zh # Chinese onlyAll flags
Flags:
--lang string Language: auto, en, zh (default "auto")
-v, --voice string Voice name (default depends on language)
-s, --speed float Speed multiplier 0.5–2.0 (default 1.0)
-o, --output string Save WAV to file instead of playing
--no-progress Suppress download progress bar
-h, --help HelpHow it works
On first use, talk downloads the appropriate engine bundle and model:
~/.cache/talk-cli/
├── en/
│ ├── engine/ # PyInstaller-packaged Kokoro ONNX or MLX engine
│ └── model/ # model.onnx + voices.bin (~88 MB INT8)
└── zh/
├── engine/ # PyInstaller-packaged Kokoro ONNX engine
└── model/ # model.onnx + voices.bin + config.json (~82 MB INT8)The Go binary manages downloads, invokes the engine subprocess with JSON arguments, and plays back the WAV output. Language auto-detection uses Unicode CJK block (U+4E00–U+9FFF).
Models
| Language | Model | Size | Source | |----------|-------|------|--------| | English | Kokoro v1.0 (INT8 ONNX) | ~88 MB | thewh1teagle/kokoro-onnx | | Chinese | Kokoro v1.1-zh (INT8 ONNX) | ~82 MB | hoveyc/talk-cli-models | | English (MLX) | Kokoro-82M-bf16 | streamed | mlx-community/Kokoro-82M-bf16 |
AI Agent Integration
talk-cli ships with AI skills compatible with Claude Code, Cursor, and other AI coding agents. Install the skill to let your AI assistant use talk-cli:
npx skills add hoveychen/talk-cliContributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
