A blazing fast CLI tool that converts PDFs to nicely formatted markdown files. Rebuilt with Bun for speed and ease of use.
- Blazing Fast: Built on Bun.
- AI-Powered: Uses Google Gemini 3 Flash Preview for intelligent formatting.
- Standalone Mode: Quick raw text extraction.
- Bulk Processing: Convert entire directories recursively.
- Configurable: Persist your API key so you don't have to type it every time.
- Clone the repo:
git clone https://github.com/pc-style/pdf2md-cli.git cd pdf2md-cli - Install dependencies:
bun install
- Build the binary:
bun run build
bash <(curl -fsSL https://raw.githubusercontent.com/pc-style/pdf2md-cli/main/install.sh)To install the tool globally on your system manually (requires sudo for /usr/local/bin):
./install.shThis will build the binary and move it to /usr/local/bin/pdf2md, making the pdf2md command available anywhere.
To use the AI features, set your Gemini API key:
./pdf2md config --key YOUR_API_KEYTo remove it later: pdf2md config --delete
AI Mode (Recommended for formatting):
./pdf2md document.pdf --mode aiStandalone Mode (Raw text only):
./pdf2md document.pdfConvert all PDFs in a directory:
./pdf2md ./my-docs/ --mode aiMIT