Leokani command line
Text to speech from a terminal, offline. This page installs it on a Mac with Apple silicon and macOS 15 or later. For Linux and Raspberry Pi, see Linux and Raspberry Pi; the options and the MCP server are the same there.
Install
curl -O https://milliwattlabs.com/models/leokani-tts/downloads/Leokani-CLI-1.1.zip
unzip Leokani-CLI-1.1.zip
cd Leokani-CLI-1.1
./install.shThat installs ~/.local/bin/leokani. ./install.sh --system installs /usr/local/bin/leokani for every user instead. If the folder isn't on your PATH, the installer prints the line to add.
Speak
leokani "Hello! I'm Leokani." -o hello.wav
leokani "Hello there." --play
pbpaste | leokani --play
leokani --speed 1.25 -o story.wav < story.txtWith no text, leokani reads standard input. Give -o, --play, or both.
Options
| Option | |
|---|---|
-o, --output FILE | Write a 24 kHz mono WAV. -o - writes to standard output. |
-p, --play | Play through the default output. |
-s, --speed N | 0.5 to 2.0. Default 1.0. |
--float | 32-bit float WAV instead of 16-bit. |
--verbose | Print timings to standard error. |
-V, --version | Version and credits. |
-h, --help | Help. |
Put -- before text that starts with -.
Exit status
| Code | |
|---|---|
| 0 | Done |
| 1 | Failed |
| 2 | Bad arguments |
| 3 | Nothing to say |
| 4 | Can't write the file |
MCP server
leokani mcp is a Model Context Protocol server on standard input and output. Add it to Claude Code:
claude mcp add leokani -- ~/.local/bin/leokani mcpOr to Claude Desktop (Settings > Developer > Edit Config) or another MCP client:
{
"mcpServers": {
"leokani": {
"command": "/Users/YOU/.local/bin/leokani",
"args": ["mcp"]
}
}
}| Tool | Arguments | |
|---|---|---|
speak | text, speed | Reads the text aloud. |
synthesize | text, speed, path | Saves a 24 kHz WAV. Without path, a new file in ~/Music/Leokani. Never overwrites. |
stop | Stops speaking. |
Uninstall
rm -rf ~/.local/bin/leokani ~/.local/share/leokaniAfter --system: sudo rm -rf /usr/local/bin/leokani /usr/local/share/leokani.
Leokani-tts is CC BY-NC 4.0. For a commercial license or a custom voice, email hello@milliwattlabs.com.