Skip to content

CLI tool to convert PDF documents to clean Markdown format

Notifications You must be signed in to change notification settings

pc-style/pdf2md-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF to Markdown Converter (Bun Edition)

A blazing fast CLI tool that converts PDFs to nicely formatted markdown files. Rebuilt with Bun for speed and ease of use.

Features

  • 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.

Installation

Prerequisites

Setup

  1. Clone the repo:
    git clone https://github.com/pc-style/pdf2md-cli.git
    cd pdf2md-cli
  2. Install dependencies:
    bun install
  3. Build the binary:
    bun run build

Quick Install (One-liner)

bash <(curl -fsSL https://raw.githubusercontent.com/pc-style/pdf2md-cli/main/install.sh)

Global Installation

To install the tool globally on your system manually (requires sudo for /usr/local/bin):

./install.sh

This will build the binary and move it to /usr/local/bin/pdf2md, making the pdf2md command available anywhere.

Usage

1. Configure API Key (One-time setup)

To use the AI features, set your Gemini API key:

./pdf2md config --key YOUR_API_KEY

To remove it later: pdf2md config --delete

2. Convert a PDF

AI Mode (Recommended for formatting):

./pdf2md document.pdf --mode ai

Standalone Mode (Raw text only):

./pdf2md document.pdf

3. Bulk Conversion

Convert all PDFs in a directory:

./pdf2md ./my-docs/ --mode ai

License

MIT

About

CLI tool to convert PDF documents to clean Markdown format

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published