Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

readthis

A command-line text-to-speech tool powered by Kokoro-82M. Feed it plain text, a URL, piped input, or your clipboard, it extracts the content and reads it aloud. Audio generation and playback run on separate threads, so speech starts almost immediately rather than waiting for the full text to be synthesised.

demo.mp4

Installation

Requires Python 3.12 and uv.

uv tool install --python 3.12 git+https://github.com/realpacific/readthis

Usage

# Plain text
readthis "Hello, this is a test"

# URL — extracts and reads the article
readthis https://prashantbarahi.com.np/blog/be-nice

# Piped / multiline input
echo "First line.\nSecond line." | readthis
cat article.txt | readthis

# Pipe contents from your clipboard
pbpaste | readthis

# No argument — reads from clipboard
readthis

Options

readthis [input] [--voice VOICE] [--speed SPEED] [--lang LANG]
Flag Default Description
--voice af_heart Voice name
--speed 1.0 Speech speed
--lang a Language code (a = American English)

Configuration

# print current config
readthis config

readthis config --help

# Set a default voice
readthis config --voice af_bella

# Set a default speech speed
readthis config --speed 1.2
Flag Description
--voice Default voice name
--speed Default speech speed multiplier

Examples

readthis "Good morning" --voice af_heart --speed 1.2
readthis https://prashantbarahi.com.np/blog/be-nice --speed 1.5
readthis  # reads whatever is in your clipboard

Summarizer + TTS

My favorite way of using this is with realpacific/summarizer. Pipe summarizer's output to readthis to turn any summary into on-demand audio.

Install realpacific/summarizer:

uv tool install git+https://github.com/realpacific/summarizer
# initialize it
summarizer init

Pipe output from realpacific/summarizer to realpacific/readthis:

# Summarize a URL and read it aloud
summarizer https://prashantbarahi.com.np/blog/your-readme-md-is-obsolete | readthis

# For dynamic pages or paywalled content, copy to clipboard and pipe:
pbpaste | summarizer | readthis

About

CLI-based on-device Text-to-Speech using Kokoro-82M

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages