Skip to content

CLI ​

The same binary is a command-line converter, like MarkItDown but much faster. Install it with npm install -g @sylphx/anymd, or run it once with npx -y @sylphx/anymd <file>.

bash
anymd report.pdf > report.md                 # a file
anymd deck.pptx notes.docx budget.xlsx        # several files, each with a header
anymd https://example.com/article            # a web page (main content only)
cat scan.png | anymd - --ocr                 # stdin, with OCR
anymd paper.pdf --pages 1-3 --max-tokens 4000
anymd search "indemnification" contracts/ --glob '*.pdf'
anymd doctor                                 # lists the optional tools anymd found

Commands ​

CommandWhat it does
anymd <file|url|dir>... [options]Convert to Markdown on stdout
anymd - [options]Convert stdin (the format is detected from the bytes)
anymd search <query> [path|url...]Search files and directories (default: .)
anymd mcp [--allow-dir=<path>]...Run the MCP server on stdio
anymd doctorPrint the version and which optional tools were found

With no file arguments and a piped stdin (which is how MCP clients launch it), anymd serves MCP over stdio, so npx -y @sylphx/anymd works as both a CLI and a server.

Read options ​

OptionDescription
-p, --pages <spec>Pages, slides, sheets, or chapters, e.g. 1-5,8
-o, --output <file>Write to a file instead of stdout
--max-tokens <n>Stop at a token budget and print a cursor. The CLI has no budget unless you set one.
--cursor <cursor>Continue from a cursor
--ocr / --no-ocrForce or disable OCR (default: automatic when tesseract is installed)
--transcriptTranscribe audio/video with a local whisper.cpp
--download-whisper-modelDownload the ggml whisper model on first use (implies --transcript; see Transcripts)
--front-matterPrint the source/title/pages header (always on for several inputs)

Search options ​

OptionDescription
--mode <m>auto (default), literal, or ranked (BM25)
--glob <glob>Only files matching the glob, e.g. '*.pdf'
--max <n>Maximum hits (default 20)
-i, --case-sensitiveMatch case
-w, --whole-wordMatch whole words

Other flags ​

OptionDescription
--allow-dir=<path>Confine file access to this directory (repeatable). See Security.
-h, --helpShow help
-V, --versionShow the version

Exit codes ​

CodeMeaning
0Success
1An input could not be read, or the output could not be written
2Usage error (unknown option, missing value, no input)

Examples ​

Convert a folder of reports into Markdown files:

bash
for f in reports/*.pdf; do anymd "$f" -o "${f%.pdf}.md"; done

Read a long PDF in chunks:

bash
anymd book.pdf --max-tokens 8000            # ends with: Continue with cursor: "42"
anymd book.pdf --max-tokens 8000 --cursor 42

Ranked search when you do not know the exact wording:

bash
anymd search "how is attention scaled" papers/ --mode ranked --max 5

MIT licensed · local, no API key