
Sherpa Onnx Tts
- 3.1k installs
- 385k repo stars
- Updated August 3, 2026
- steipete/clawdis
sherpa-onnx-tts is an OpenClaw agent skill that runs offline text-to-speech through the sherpa-onnx CLI using downloaded runtime and Piper model directories.
About
sherpa-onnx-tts is an OpenClaw agent skill for local offline text-to-speech using the sherpa-onnx CLI wrapper and Piper voice models. Install steps download platform-specific runtime archives for macOS Linux and Windows into the OpenClaw tools directory, then fetch a voice model such as vits-piper-en_US-lessac-high into models. Configuration writes SHERPA_ONNX_RUNTIME_DIR and SHERPA_ONNX_MODEL_DIR into the active openclaw.json skills.entries env block after resolving OPENCLAW_STATE_DIR or default ~/.openclaw paths. Usage runs the bin wrapper with -o output.wav and quoted text, with optional SHERPA_ONNX_MODEL_FILE or --model-file when multiple onnx files exist. Windows invocation uses node on the wrapper path. The skill supports darwin linux and win32, requires those environment variables, and notes picking alternate voices from sherpa-onnx tts-models releases. No cloud API is needed once runtime and model directories are present, making it suitable for private agent workflows that need spoken output without network TTS services.
- Offline local TTS via sherpa-onnx CLI wrapper with no cloud dependency after setup.
- Install downloads platform runtime tarballs and Piper en_US lessac high voice model.
- Requires SHERPA_ONNX_RUNTIME_DIR and SHERPA_ONNX_MODEL_DIR in OpenClaw skill env config.
- CLI usage: wrapper -o ./tts.wav with quoted text; optional --model-file override.
- Supports macOS Linux and Windows with documented node invocation on win32.
Sherpa Onnx Tts by the numbers
- 3,091 all-time installs (skills.sh)
- +159 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #251 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 3, 2026 (Skillselion catalog sync)
sherpa-onnx-tts capabilities & compatibility
- Capabilities
- platform runtime download install steps · piper voice model download and directory layout · openclaw env configuration for runtime and model · cli wav synthesis with output path flag · optional model file override for multi onnx dire · windows node wrapper invocation guidance
- Use cases
- orchestration · translation
- Platforms
- macOS · Linux · Windows
- Runs
- Runs locally
- Pricing
- Free
What sherpa-onnx-tts says it does
Local text-to-speech via sherpa-onnx (offline, no cloud)
Local TTS using the sherpa-onnx offline CLI.
{baseDir}/bin/sherpa-onnx-tts -o ./tts.wav "Hello from local TTS."
npx skills add https://github.com/steipete/clawdis --skill sherpa-onnx-ttsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 3.1k |
|---|---|
| repo stars | ★ 385k |
| Security audit | 3 / 3 scanners passed |
| Last updated | August 3, 2026 |
| Repository | steipete/clawdis ↗ |
How do I add local spoken agent output without sending text to cloud TTS APIs or leaving the machine?
Run offline local text-to-speech with the sherpa-onnx CLI wrapper after installing runtime and voice model directories.
Who is it for?
OpenClaw users who need private offline voice playback with sherpa-onnx and Piper models on desktop OS targets.
Skip if: Cloud TTS services, real-time streaming telephony, or environments where downloading native runtimes is blocked.
When should I use this skill?
User needs local offline TTS, sherpa-onnx setup, or OpenClaw voice output without network calls.
What you get
Configured sherpa-onnx runtime and model paths that generate WAV files from CLI invocations inside OpenClaw.
- Audio output file
- CLI invocation configuration
Files
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:
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):
{
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:
export PATH="{baseDir}/bin:$PATH"Usage
{baseDir}/bin/sherpa-onnx-tts -o ./tts.wav "Hello from local TTS."Notes:
- Pick a different model from the sherpa-onnx
tts-modelsrelease if you want another voice. - If the model dir has multiple
.onnxfiles, setSHERPA_ONNX_MODEL_FILEor pass--model-file. - You can also pass
--tokens-fileor--data-dirto override the defaults. - Windows: run
node {baseDir}\\bin\\sherpa-onnx-tts -o tts.wav "Hello from local TTS."
#!/usr/bin/env node
import fs from "node:fs";
import path from "node:path";
import { spawnSync } from "node:child_process";
function usage(message) {
if (message) {
console.error(message);
}
console.error(
"\nUsage: sherpa-onnx-tts [--runtime-dir <dir>] [--model-dir <dir>] [--model-file <file>] [--tokens-file <file>] [--data-dir <dir>] [--output <file>] \"text\"",
);
console.error("\nRequired env (or flags):\n SHERPA_ONNX_RUNTIME_DIR\n SHERPA_ONNX_MODEL_DIR");
process.exit(1);
}
function resolveRuntimeDir(explicit) {
const value = explicit || process.env.SHERPA_ONNX_RUNTIME_DIR || "";
return value.trim();
}
function resolveModelDir(explicit) {
const value = explicit || process.env.SHERPA_ONNX_MODEL_DIR || "";
return value.trim();
}
function resolveModelFile(modelDir, explicitFlag) {
const explicit = (explicitFlag || process.env.SHERPA_ONNX_MODEL_FILE || "").trim();
if (explicit) return explicit;
try {
const candidates = fs
.readdirSync(modelDir)
.filter((entry) => entry.endsWith(".onnx"))
.map((entry) => path.join(modelDir, entry));
if (candidates.length === 1) return candidates[0];
} catch {
return "";
}
return "";
}
function resolveTokensFile(modelDir, explicitFlag) {
const explicit = (explicitFlag || process.env.SHERPA_ONNX_TOKENS_FILE || "").trim();
if (explicit) return explicit;
const candidate = path.join(modelDir, "tokens.txt");
return fs.existsSync(candidate) ? candidate : "";
}
function resolveDataDir(modelDir, explicitFlag) {
const explicit = (explicitFlag || process.env.SHERPA_ONNX_DATA_DIR || "").trim();
if (explicit) return explicit;
const candidate = path.join(modelDir, "espeak-ng-data");
return fs.existsSync(candidate) ? candidate : "";
}
function resolveBinary(runtimeDir) {
const binName = process.platform === "win32" ? "sherpa-onnx-offline-tts.exe" : "sherpa-onnx-offline-tts";
return path.join(runtimeDir, "bin", binName);
}
function prependEnvPath(current, next) {
if (!next) return current;
if (!current) return next;
return `${next}${path.delimiter}${current}`;
}
const args = process.argv.slice(2);
let runtimeDir = "";
let modelDir = "";
let modelFile = "";
let tokensFile = "";
let dataDir = "";
let output = "tts.wav";
const textParts = [];
for (let i = 0; i < args.length; i += 1) {
const arg = args[i];
if (arg === "--runtime-dir") {
runtimeDir = args[i + 1] || "";
i += 1;
continue;
}
if (arg === "--model-dir") {
modelDir = args[i + 1] || "";
i += 1;
continue;
}
if (arg === "--model-file") {
modelFile = args[i + 1] || "";
i += 1;
continue;
}
if (arg === "--tokens-file") {
tokensFile = args[i + 1] || "";
i += 1;
continue;
}
if (arg === "--data-dir") {
dataDir = args[i + 1] || "";
i += 1;
continue;
}
if (arg === "-o" || arg === "--output") {
output = args[i + 1] || output;
i += 1;
continue;
}
if (arg === "--text") {
textParts.push(args[i + 1] || "");
i += 1;
continue;
}
textParts.push(arg);
}
runtimeDir = resolveRuntimeDir(runtimeDir);
modelDir = resolveModelDir(modelDir);
if (!runtimeDir || !modelDir) {
usage("Missing runtime/model directory.");
}
modelFile = resolveModelFile(modelDir, modelFile);
tokensFile = resolveTokensFile(modelDir, tokensFile);
dataDir = resolveDataDir(modelDir, dataDir);
if (!modelFile || !tokensFile || !dataDir) {
usage(
"Model directory is missing required files. Set SHERPA_ONNX_MODEL_FILE, SHERPA_ONNX_TOKENS_FILE, SHERPA_ONNX_DATA_DIR or pass --model-file/--tokens-file/--data-dir.",
);
}
const text = textParts.join(" ").trim();
if (!text) {
usage("Missing text.");
}
const bin = resolveBinary(runtimeDir);
if (!fs.existsSync(bin)) {
usage(`TTS binary not found: ${bin}`);
}
const env = { ...process.env };
const libDir = path.join(runtimeDir, "lib");
if (process.platform === "darwin") {
env.DYLD_LIBRARY_PATH = prependEnvPath(env.DYLD_LIBRARY_PATH || "", libDir);
} else if (process.platform === "win32") {
env.PATH = prependEnvPath(env.PATH || "", [path.join(runtimeDir, "bin"), libDir].join(path.delimiter));
} else {
env.LD_LIBRARY_PATH = prependEnvPath(env.LD_LIBRARY_PATH || "", libDir);
}
const outputPath = path.isAbsolute(output) ? output : path.join(process.cwd(), output);
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
const child = spawnSync(
bin,
[
`--vits-model=${modelFile}`,
`--vits-tokens=${tokensFile}`,
`--vits-data-dir=${dataDir}`,
`--output-filename=${outputPath}`,
text,
],
{
stdio: "inherit",
env,
},
);
if (typeof child.status === "number") {
process.exit(child.status);
}
if (child.error) {
console.error(child.error.message || String(child.error));
}
process.exit(1);
Related skills
Forks & variants (1)
Sherpa Onnx Tts has 1 known copy in the catalog totaling 8 installs. They canonicalize to this original listing.
- firecrawl - 8 installs
How it compares
Use sherpa-onnx-tts for local ONNX-based speech; use cloud TTS API skills when managed voice services and hosted models are acceptable.
FAQ
Which environment variables are required?
SHERPA_ONNX_RUNTIME_DIR and SHERPA_ONNX_MODEL_DIR must point at the extracted runtime and model folders.
How do I generate a WAV file?
Run the bin wrapper with -o ./tts.wav followed by the text string to synthesize.
Can I switch voices?
Download a different model from the sherpa-onnx tts-models release and update SHERPA_ONNX_MODEL_DIR or pass --model-file.
Is Sherpa Onnx Tts safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.