Convert documents to Markdown
Run the anydoc CLI and write Markdown to stdout or a file:
anydoc <file> # Markdown to stdout
anydoc <file> -o out.md # write to a file
anydoc - --format csv < f # read stdin
First-time install
If command -v anydoc fails, install the PATH-first wrapper used on this workstation:
mkdir -p ~/.local/bin
cat > ~/.local/bin/anydoc <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
exec bunx @firecrawl/anydoc@latest "$@"
EOF
chmod +x ~/.local/bin/anydoc
Requirements and checks:
- Keep
~/.local/binonPATHahead of later package-manager bin dirs. - Requires Bun so
bunxcan fetch@firecrawl/anydoc@latest. - Verify with
command -v anydocandanydoc -V. - Prefer this wrapper over a permanent Bun/npm global install of
@firecrawl/anydoc.
Rules
- Supported inputs:
.doc,.docx,.docm,.odt,.rtf,.epub,.pdf,.ppt,.pps,.pot,.pptx,.pptm,.ppsx,.ppsm,.odp,.xls,.xlsx,.xlsm,.xlsb,.ods,.csv. - 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. Failures print one
anydoc: <message>line to stderr. The CLI never prompts. - For a large document, write to a file with
-oand read the parts you need instead of streaming everything into context. - Scanned and image-only PDFs need OCR, which anydoc does not do; they fail as unsupported. The hosted Firecrawl Parse API handles those.
- Inside a Node, Python, or Rust codebase, prefer the library over shelling out:
@firecrawl/anydocon npm,firecrawl-anydocon PyPI,anydocon crates.io. Each exposes the sameto_markdown/toMarkdownAPI.
