CLI Reference
The ebook-rs command-line interface provides high-performance utilities for inspecting, querying, converting, and serving eBook collections.
Commands Overview
Section titled “Commands Overview”ebook-rs <COMMAND> [OPTIONS]1. parse
Section titled “1. parse”Prints eBook metadata, Table of Contents (TOC), and spine structure in JSON format.
ebook-rs parse <path.epub|mobi|pdf|fb2|docx|rtf>2. search
Section titled “2. search”Runs high-speed SIMD accelerated full-text search across all book chapters and prints matched CFI locators and highlighted snippets.
ebook-rs search <path.epub> "search term"3. convert
Section titled “3. convert”Converts any supported input format (MOBI, AZW3, KFX, FB2, LIT, DOCX, RTF, PDF, TXT) to EPUB 3, Amazon KFX, or AI RAG JSON.
# Convert MOBI to EPUB 3ebook-rs convert book.mobi output.epub
# Convert EPUB to Amazon KFXebook-rs convert book.epub output.kfx
# Export AI RAG JSON Chunksebook-rs convert book.epub output.json4. mcp
Section titled “4. mcp”Launches the Model Context Protocol (MCP 2024-11-05) JSON-RPC server on stdio for AI assistant integration.
ebook-rs mcp5. serve
Section titled “5. serve”Spins up a lightweight local HTTP server and in-browser interactive eBook reader on port 8080.
ebook-rs serve book.epub6. locations
Section titled “6. locations”Computes IDPF Readium CFI reading progress locations across the entire book.
ebook-rs locations book.epub```\n