- Bun (for building from source or running the script directly)
The easiest way to install is using the provided installation script:
./install.sh-
Clone the repository:
git clone https://github.com/pc-style/pdf2md-cli.git cd pdf2md-cli -
Install dependencies:
bun install
-
Build the binary:
bun run build
This will create a standalone
pdf2mdexecutable in thebin/directory. -
(Optional) Move to your PATH:
mv bin/pdf2md /usr/local/bin/
To use the AI-powered formatting (Gemini), you need an API Key.
pdf2md config --key YOUR_GEMINI_API_KEYStandalone Mode (Fast, extract text only):
./pdf2md input.pdfAI Mode (Smart formatting):
./pdf2md input.pdf --mode aiProcess an entire directory of PDFs:
./pdf2md ./documents/ --mode ai./pdf2md --help