Skip to content

CLI Reference

The ebook-rs command-line interface provides high-performance utilities for inspecting, querying, converting, and serving eBook collections.

Terminal window
ebook-rs <COMMAND> [OPTIONS]

Prints eBook metadata, Table of Contents (TOC), and spine structure in JSON format.

Terminal window
ebook-rs parse <path.epub|mobi|pdf|fb2|docx|rtf>

Runs high-speed SIMD accelerated full-text search across all book chapters and prints matched CFI locators and highlighted snippets.

Terminal window
ebook-rs search <path.epub> "search term"

Converts any supported input format (MOBI, AZW3, KFX, FB2, LIT, DOCX, RTF, PDF, TXT) to EPUB 3, Amazon KFX, or AI RAG JSON.

Terminal window
# Convert MOBI to EPUB 3
ebook-rs convert book.mobi output.epub
# Convert EPUB to Amazon KFX
ebook-rs convert book.epub output.kfx
# Export AI RAG JSON Chunks
ebook-rs convert book.epub output.json

Launches the Model Context Protocol (MCP 2024-11-05) JSON-RPC server on stdio for AI assistant integration.

Terminal window
ebook-rs mcp

Spins up a lightweight local HTTP server and in-browser interactive eBook reader on port 8080.

Terminal window
ebook-rs serve book.epub

Computes IDPF Readium CFI reading progress locations across the entire book.

Terminal window
ebook-rs locations book.epub
```\n