CLI tool to convert EPUB files to Markdown, select a section via TUI, and summarize it using an OpenAI-compatible LLM with Chain of Density.
npm install
npm run build
Purpose: convert supported formats (EPUB, PDF) to Markdown.
How it works: picks a converter by input extension and writes Markdown to a file.
Parameters: --input <path>, --output <path> (optional, defaults next to input)
Example:
node dist/cli/index.js import --input /path/to/book.epub --output /path/to/book.md
PDF example:
node dist/cli/index.js import --input /path/to/book.pdf --output /path/to/book.md
Default output example:
node dist/cli/index.js import --input /path/to/book.epub
Without build:
npm run dev -- import --input /path/to/book.epub --output /path/to/book.md
Purpose: summarize Markdown with chapter selection via TUI.
How it works: parses headings, lets you pick a section, sends selected text to the LLM.
Parameters: --input <path>, --output <path>, --method <stuff-dense|stuff-quotations>, --export <formats>, --overwrite
If --output points to a directory, filename defaults to summary-<method>.md.
Example:
node dist/cli/index.js summarize --input /path/to/book.md --output /path/to/summary.md
With method and export:
node dist/cli/index.js summarize --input /path/to/book.md --output /path/to/summary.md --method stuff-quotations --export html,pdf
Without build:
npm run dev -- summarize --input /path/to/book.md --output /path/to/summary.md
Purpose: export Markdown to HTML or PDF.
How it works: converts Markdown to the selected format and saves next to input.
Parameters: --input <path>, --format <html|pdf>, --overwrite
Example:
node dist/cli/index.js export --input /path/to/summary.md --format html
Without build:
npm run dev -- export --input /path/to/summary.md --format pdf
Copy .env.example to .env and adjust values:
LLM_URL,LLM_MODEL,LLM_API_KEYLLM_MAX_CONTEXT_TOKENS,LLM_MAX_OUTPUT_TOKENSLLM_TEMPERATURE,LLM_TOP_P, penalties