展示HN:Lue – 带有文本转语音功能的终端电子书阅读器
Show HN: Lue – Terminal eBook Reader with Text-to-Speech

原始链接: https://github.com/superstarryeyes/lue

## Lue:一个命令行电子书阅读器 Lue是一个跨平台、命令行电子书阅读器,支持多种格式,包括EPUB、PDF、TXT等。它具有丰富的、可定制的终端UI,并提供完整的键盘和鼠标支持,以实现高效导航。 主要功能包括无缝的TTS,提供Edge TTS(在线)和Kokoro TTS(本地/离线)选项,以及可扩展的架构,用于添加新的TTS模型。Lue可以智能地保存阅读进度,并支持100多种语言。 **入门:** 需要安装FFmpeg。克隆GitHub仓库 ([https://github.com/superstarryeyes/lue](https://github.com/superstarryeyes/lue)),使用`pip`安装依赖项,并使用`python -m lue [书文件]`运行。 使用选项自定义TTS模型、语音和语言。内置帮助系统 (`lue --help`) 详细介绍了可用命令和用于导航和播放控制的键绑定。

## Lue:一个带有TTS功能的终端电子书阅读器 Lue是一个新的、开源的终端电子书阅读器,最近由其创建者“superstarryeyes”在GitHub上发布。开发者对现有的有声书转换工具感到沮丧,因此构建了Lue,旨在提供一种简单、可定制的体验:只需提供一本电子书,它就会立即开始阅读。 Lue支持多种格式(EPUB、PDF、TXT等),并具有模块化的TTS系统,目前使用Edge和Kokoro TTS引擎,并提供Kitten和Gemini等其他引擎的模块。它拥有丰富的终端UI,支持键盘/鼠标操作,可定制的主题和自动进度保存。它跨平台(macOS、Linux、Windows),并支持100多种语言。 早期的反馈集中在潜在的改进上,例如减少外部依赖、探索GUI选项以及完善对脚注等格式元素的处理。开发者乐于接受反馈,并积极与社区讨论增强功能,包括解决Python版本兼容性和PDF解析挑战。 你可以在GitHub上找到该项目:[https://github.com/superstarryeyes/lue](https://github.com/superstarryeyes/lue)
相关文章

原文

Feature Description
📖 Multi-Format Support Support for EPUB, PDF, TXT, DOCX, DOC, HTML, RTF, and Markdown with seamless format detection
👄 Modular TTS System Edge TTS (default) and Kokoro TTS (local/offline) with extensible architecture for new models
🌌 Rich Terminal UI Clean, responsive interface with customizable color themes and full mouse & keyboard support
💾 Smart Persistence Automatic progress saving, state restoration, and cross-session continuity for seamless reading
🌍 Cross-Platform & Multilingual Full support for macOS, Linux, Windows with 100+ languages and consistent global experience
⚡️ Fast Navigation Intuitive shortcuts, flexible controls, and smooth scrolling for efficient book navigation

Want to try Lue right away? Follow these simple steps:

# 1. Install FFmpeg (required for audio processing)
# macOS
brew install ffmpeg
# Ubuntu/Debian  
sudo apt install ffmpeg
# Windows: Download from ffmpeg.org and add to PATH

# 2. Clone and setup
git clone https://github.com/superstarryeyes/lue.git
cd lue
pip install -r requirements.txt

# 3. Start reading!
python -m lue sample.txt

📝 Note: Quick start uses Edge TTS (requires internet). For offline capabilities, see full installation.


  • FFmpeg - Audio processing (required)
  • espeak - Kokoro TTS support
  • antiword - .doc file support
brew install ffmpeg
# Optional
brew install espeak antiword
sudo apt update && sudo apt install ffmpeg
# Optional  
sudo apt install espeak antiword

Download FFmpeg from ffmpeg.org and add to PATH.

# 1. Clone repository
git clone https://github.com/superstarryeyes/lue.git
cd lue

# 2. Install dependencies
pip install -r requirements.txt

# 3. Install Lue
pip install .

Enable Kokoro TTS (Optional)

For local/offline TTS capabilities:

# 1. Edit requirements.txt - uncomment Kokoro packages:
kokoro>=0.9.4
soundfile>=0.13.1
huggingface-hub>=0.34.4

# 2. Install PyTorch
# CPU version:
pip install torch torchvision torchaudio
# GPU version (CUDA):
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

# 3. Install updated requirements
pip install -r requirements.txt

# 4. Install Lue
pip install .

# Start with default TTS
lue path/to/your/book.epub

# Use specific TTS model  
lue --tts kokoro path/to/your/book.epub

# Use a specific voice (full list at VOICES.md)
lue --voice "en-US-AriaNeural" path/to/your/book.epub

# Specify a language code if needed
lue --lang a path/to/your/book.epub

# Enable PDF cleaning filter (removes page numbers, headers and footnotes)
lue --filter path/to/your/book.pdf

# View available options
lue --help
Key Binding Action Description
q Quit the application and save current reading progress automatically
p Pause or resume the text-to-speech audio playback
a Toggle auto-scroll mode to automatically advance during TTS playback
t Select and highlight the top sentence of the current visible page
h / l Move the reading line to the previous or next paragraph in the document
j / k Move the reading line to the previous or next sentence in the document
i / m Jump up or down by full pages for rapid navigation through longer documents
u / n Scroll up or down by smaller increments for fine-grained position control
y / b Jump directly to the beginning or end of the document for quick navigation
  • 🖱️ Click - Jump to sentence
  • 🔄 Scroll - Navigate content
  • 📍 Progress bar click - Jump to position

Interested in extending Lue?

Check out the Developer Guide for instructions on adding new TTS models and contributing to the project.

Reading Progress:

  • macOS: ~/Library/Application Support/lue/
  • Linux: ~/.local/share/lue/
  • Windows: C:\Users\<User>\AppData\Local\lue\

Error Logs:

  • macOS: ~/Library/Logs/lue/error.log
  • Linux: ~/.cache/lue/log/error.log
  • Windows: C:\Users\<User>\AppData\Local\lue\Logs\error.log

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.


Contributions are welcome! Please feel free to submit a Pull Request.


Made with 💖 for CLI enthusiasts and bookworms

⭐ Star this repo if you find it useful!

联系我们 contact @ memedata.com