# Leokani command line for Linux

`leokani` reads text aloud, offline. It's the command-line version of the Leokani app.

You need 64-bit Linux with glibc 2.28 or later: Debian 11 or later, Ubuntu 20.04 or later, Fedora, or Raspberry Pi
OS 64-bit (Pi 3, 4, 5 and Zero 2 W). Use the x86_64 download for Intel and AMD PCs and aarch64 for a Raspberry Pi or
another ARM computer. Nothing else to install.

## Install

In a terminal, in the folder you unpacked:

    ./install.sh             # for you: ~/.local/bin/leokani
    ./install.sh --system    # for everyone: /usr/local/bin/leokani (asks for your password)

If ~/.local/bin isn't on your PATH, the installer says how to add it. You can also run `bin/leokani` from the
unpacked folder without installing.

## Examples

    leokani "Hello! I'm Leokani." -o hello.wav
    leokani "Hello there." --play
    leokani --speed 1.25 --float -o story.wav < story.txt
    cat notes.txt | leokani -o - | aplay

Output is a 24 kHz mono WAV, 16-bit (or 32-bit float with `--float`). `--speed` goes from 0.5 to 2.0. `--play` uses
PulseAudio or PipeWire, else ALSA. Run `leokani --help` for everything else.

It uses up to 4 CPU cores. `LEOKANI_THREADS=1 leokani …` keeps it to one, for a busy machine.

Exit status: 0 done, 1 failed, 2 bad arguments, 3 nothing to say, 4 can't write the file.

## Use with Claude

- Claude Code: `claude mcp add leokani -- ~/.local/bin/leokani mcp`
- Claude Desktop: in Settings > Developer > Edit Config, add `"leokani": {"command": "/home/YOU/.local/bin/leokani", "args": ["mcp"]}` under `"mcpServers"`.
- Then ask Claude to say something out loud, or to save it as a WAV (in ~/Music/Leokani unless you give a path).

## Uninstall

    rm -rf ~/.local/bin/leokani ~/.local/share/leokani ~/.local/lib/leokani

(or `sudo rm -rf /usr/local/bin/leokani /usr/local/share/leokani /usr/local/lib/leokani` if you used `--system`).

## Licence

Leokani-tts is by Milliwatt Labs and is licensed under CC BY-NC 4.0, so it's for non-commercial use only.
`leokani --version` shows the credits: distilled from Kokoro-82M by hexgrad (Apache-2.0); pronunciation by espeak-ng
(GPL-3.0, source: https://github.com/espeak-ng/espeak-ng/tree/8269af044a94273f030fbfd3fa9033dd664db578); ONNX Runtime
by Microsoft (MIT). The licence texts are in share/leokani/Licenses.

If you have a problem or feedback, tell the person who sent you Leokani.
