Skip to content

csamu/kittentts-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kitten TTS CLI

A simple command-line interface for KittenTTS - a lightweight text-to-speech library.

Installation

Local development

uv sync
uv run kittentts "Your text here"

Global installation

Install as a system-wide tool (without GPU dependencies):

uv tool install --overrides skip-gpu.txt .
kittentts "Your text here"

Usage

Options

Option Default Description
text Text to convert (reads from stdin if not provided)
--model mini Model to use (mini, micro, nano, nano-int8)
--voice Bruno Voice to use
--speed 1.0 Speech speed multiplier
--output audio.wav Output file path (- for stdout)
--mp3 Output as MP3 (replaces .wav with .mp3 or appends .mp3)
--list-voices List available voices and exit
--normalize Convert numbers, currencies, abbreviations, etc. to readable text

Available Models

Model Parameters Size
mini 80M 80 MB
micro 40M 41 MB
nano 15M 56 MB
nano-int8 15M 25 MB

Voices

Voice names vary by model. Use --list-voices to see available voices for the selected model.

Examples

# Basic usage
uv run kittentts "Hello, world!"

# Use a different voice (use --list-voices to see options)
uv run kittentts --voice Kiki "Hello, world!"

# Use a smaller/faster model
uv run kittentts --model nano "Hello, world!"

# Adjust speed (faster)
uv run kittentts --speed 1.5 "Hello, world!"

# Read from stdin
echo "Hello from stdin" | uv run kittentts
cat input.txt | uv run kittentts

# Pipe audio to stdout
uv run kittentts --output - "Hello" | play -

# Both stdin and stdout
echo "hey" | uv run kittentts --output - | aplay

# Output as MP3
uv run kittentts --mp3 "Hello, world!"  # Creates audio.mp3
uv run kittentts --mp3 --output custom "Hello"  # Creates custom.mp3
uv run kittentts --mp3 --output custom.wav "Hello"  # Creates custom.mp3

# List available voices
uv run kittentts --list-voices

# Convert numbers, currencies, abbreviations, etc. to readable text
uv run kittentts --normalize "I have $100 and 2 cats"

Requirements

  • Python 3.12+
  • KittenTTS
  • soundfile
  • ffmpeg (only required for --mp3 option)

Notes

Models are cached in ~/.cache/huggingface/hub/ after first download. Subsequent runs use the cached version.

License

MIT License - see LICENSE file for details.

About

A command-line interface for KittenTTS, the lightweight text-to-speech library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages