当用户需要使用Calibre在不同格式之间转换电子书或文档文件时使用此技能,支持EPUB转PDF、Markdown转EPUB、MOBI转EPUB、AZW等格式互转。
calibre-convert uses Calibre's ebook-convert CLI to perform ebook and document format conversion. Use it when the user wants a direct file-to-file conversion and the desired input/output formats are supported by Calibre.
ebook-convert is available in PATH.bash
./scripts/convert_with_calibre.py /path/to/input.epub /path/to/output.pdf
--:bash
./scripts/convert_with_calibre.py /path/to/book.md /path/to/book.epub -- --chapter "//h:h1" --authors "Example Author"
Use the bundled script first. It looks for ebook-convert in PATH, then common macOS install locations.
If Calibre is missing, stop and tell the user exactly which command is missing. Do not pretend the conversion succeeded.
The core command is:
bash
ebook-convert input_file output_file [options...]
Common examples:
When the user does not specify extra options, prefer the simplest possible conversion.
scripts/convert_with_calibre.py: validates paths, finds ebook-convert, and forwards extra options safely.references/examples.md: ready-to-copy conversion examples and troubleshooting notes.