sherpa-onnx-tts — Claude Code skill: what it does, how to install
Offline text-to-speech CLI using sherpa-onnx without external cloud services. Converts text into WAV audio directly on your machine.
npx skills add openclaw/openclaw --skill sherpa-onnx-tts -a claude-codeWhat sherpa-onnx-tts does
This skill runs sherpa-onnx locally to generate speech files from text. It works completely offline without sending requests to external APIs. By default, it targets the Piper en_US lessac (high) voice model, though you can override it using the --model-file, --tokens-file, or --data-dir options.
Setup requires downloading the sherpa-onnx v1.13.6 runtime for your operating system (macOS, Linux x64, or Windows x64) and extracting a voice model. You then set the SHERPA_ONNX_RUNTIME_DIR and SHERPA_ONNX_MODEL_DIR variables in ~/.openclaw/openclaw.json. On Windows, the wrapper runs via Node.js.
Install this if you need private, offline speech generation and want to avoid third-party API costs. If you lack local disk space for the runtime binary and model files, stick with cloud-based audio providers.
What it helps with
- Generate WAV speech files from text without an internet connection
- Run offline voice synthesis on macOS, Linux, or Windows
- Switch local Piper ONNX voice models via command-line flags
Example prompts for the agent
- Convert this text to ./tts.wav using sherpa-onnx-tts
- Run sherpa-onnx-tts to speak "Hello from local TTS." into tts.wav
How to install sherpa-onnx-tts
1Skills CLI (Vercel)
npx skills add openclaw/openclaw --skill sherpa-onnx-tts -a claude-code2Manually: put the files in place
~/.claude/skills/sherpa-onnx-tts/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/sherpa-onnx-tts/
1Skills CLI (Vercel)
npx skills add openclaw/openclaw --skill sherpa-onnx-tts -a codex2Manually: put the files in place
.agents/skills/sherpa-onnx-tts/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add openclaw/openclaw --skill sherpa-onnx-tts -a cursor2Manually: put the files in place
.cursor/skills/sherpa-onnx-tts/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install openclaw/openclaw sherpa-onnx-tts2Manually: put the files in place
.github/skills/sherpa-onnx-tts/SKILL.md1Skills CLI (Vercel)
npx skills add openclaw/openclaw --skill sherpa-onnx-tts -a gemini-cli2Platform CLI
gemini skills install https://github.com/openclaw/openclaw --path skills/sherpa-onnx-ttsManually: put the files in place
.devin/skills/sherpa-onnx-tts/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add openclaw/openclaw --skill sherpa-onnx-tts -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set45
The whole set →Similar
Questions about sherpa-onnx-tts
How do I install sherpa-onnx-tts in Claude Code?
Run npx skills add openclaw/openclaw --skill sherpa-onnx-tts -a claude-code. Next, download the sherpa-onnx runtime and your chosen model into the OpenClaw tools directory.
Which environment variables are required?
You must configure SHERPA_ONNX_RUNTIME_DIR pointing to the runtime folder and SHERPA_ONNX_MODEL_DIR pointing to your extracted voice model.
Can I use a custom voice model?
Yes. Download a model archive from the sherpa-onnx repository and pass --model-file, --tokens-file, or --data-dir to point to specific model files.
Source text
SKILL.md · MIT
---
name: sherpa-onnx-tts
description: "Local text-to-speech via sherpa-onnx (offline, no cloud)"
metadata:
{
"openclaw":
{
"emoji": "🔉",
"os": ["darwin", "linux", "win32"],
"requires": { "env": ["SHERPA_ONNX_RUNTIME_DIR", "SHERPA_ONNX_MODEL_DIR"] },
"install":
[
{
"id": "download-runtime-macos",
"kind": "download",
"os": ["darwin"],
"url": "https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.13.6/sherpa-onnx-v1.13.6-osx-universal2-shared.tar.bz2",
"sha256": "05ed5839bbdfb2da36bb9095961e6b4cfa470d55e29a9795100627dbc36df2ba",
"archive": "tar.bz2",
"extract": true,
"stripComponents": 1,
"targetDir": "runtime",
"label": "Download sherpa-onnx runtime (macOS)",
},
{
"id": "download-runtime-linux-x64",
"kind": "download",
"os": ["linux"],
"url": "https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.13.6/sherpa-onnx-v1.13.6-linux-x64-shared.tar.bz2",
"sha256": "58cc7d360fdedf9702954e8b585eb400bbee8668484bf25e4461d5d22ba439d8",
"archive": "tar.bz2",
"extract": true,
"stripComponents": 1,
"targetDir": "runtime",
"label": "Download sherpa-onnx runtime (Linux x64)",
},
{
"id": "download-runtime-win-x64",
"kind": "download",
"os": ["win32"],
"url": "https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.13.6/sherpa-onnx-v1.13.6-win-x64-shared-MD-Release.tar.bz2",
"sha256": "27efaed17a64a40fd3059ac24195dcf4ec0521c999906d288cc5107cbbf4cedc",
"archive": "tar.bz2",
"extract": true,
"stripComponents": 1,
"targetDir": "runtime",
"label": "Download sherpa-onnx runtime (Windows x64)",
},
{
"id": "download-model-lessac",
"kind": "download",
"url": "https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-lessac-high.tar.bz2",
"archive": "tar.bz2",
"extract": true,
"targetDir": "models",
"label": "Download Piper en_US lessac (high)",
},
],
},
}
---
# sherpa-onnx-tts
Local TTS using the sherpa-onnx offline CLI.
## Install
1. Download the runtime for your OS (extracts into `$OPENCLAW_STATE_DIR/tools/sherpa-onnx-tts/runtime`, default `~/.openclaw/tools/sherpa-onnx-tts/runtime`)
2. Download a voice model (extracts into `$OPENCLAW_STATE_DIR/tools/sherpa-onnx-tts/models`, default `~/.openclaw/tools/sherpa-onnx-tts/models`)
Resolve the active state directory first:
```bash
STATE_DIR="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
```
Then write those resolved paths into the active OpenClaw config file (`$OPENCLAW_CONFIG_PATH`, default `~/.openclaw/openclaw.json`):
```json5
{
skills: {
entries: {
"sherpa-onnx-tts": {
env: {
SHERPA_ONNX_RUNTIME_DIR: "/path/to/your/state-dir/tools/sherpa-onnx-tts/runtime",
SHERPA_ONNX_MODEL_DIR: "/path/to/your/state-dir/tools/sherpa-onnx-tts/models/vits-piper-en_US-lessac-high",
},
},
},
},
}
```
The wrapper lives in this skill folder. Run it directly, or add the wrapper to PATH:
```bash
export PATH="{baseDir}/bin:$PATH"
```
## Usage
```bash
{baseDir}/bin/sherpa-onnx-tts -o ./tts.wav "Hello from local TTS."
```
Notes:
- Pick a different model from the sherpa-onnx `tts-models` release if you want another voice.
- If the model dir has multiple `.onnx` files, set `SHERPA_ONNX_MODEL_FILE` or pass `--model-file`.
- You can also pass `--tokens-file` or `--data-dir` to override the defaults.
- Windows: run `node {baseDir}\\bin\\sherpa-onnx-tts -o tts.wav "Hello from local TTS."`
© openclaw · MIT · openclaw/openclaw