The format is detected from the file content. Pass --format <name> only when detection cannot work: CSV from stdin, or a missing or wrong extension.
Exit codes: 0 success, 1 the document could not be converted, 2 usage error, 3 pages of a PDF need OCR. Failures print one anydoc: <message> line to stderr. The CLI never prompts.
For a large document, write to a file with -o and read the parts you need instead of streaming everything into context.
Scanned and image-only pages need OCR, which anydoc does not do, so the document exits 3. Rerun with --ocr hosted to send it to Firecrawl Parse. No signup needed. Pass --api-key or set FIRECRAWLAPIKEY for higher limits.
Inside a Node, Python, or Rust codebase, prefer the library over shelling out: @firecrawl/anydoc on npm, firecrawl-anydoc on PyPI, anydoc on crates.io. Each exposes the same to_markdown / toMarkdown API.