pdf2markdown-cli
v1.0.1
Published
CLI for pdf2markdown.io — convert PDF and images to Markdown. Sync (30MB) and async (100MB). Skills for Cursor, Codex, OpenCode.
Maintainers
Readme
PDF2Markdown CLI
Convert PDF and image documents to clean Markdown. Also available as pdf2md.
Skills (AI Coding Agents)
Install PDF2Markdown skills for Cursor, Codex, Claude Code, OpenCode, etc., so agents can convert PDFs to markdown via the CLI.
# Install to all detected agents
pdf2markdown setup skills
# or
pdf2md setup skills
# Install to a specific agent
pdf2markdown setup skills --agent cursor
pdf2md setup skills --agent opencodeSupported agents: cursor, codex, claude, opencode, agents, windsurf, continue, project (project installs to .cursor/skills and .opencode/skills).
See skills/pdf2markdown-cli/rules/install.md for full setup.
Installation
Supports macOS, Windows, and Linux.
# npm
npm install -g pdf2markdown-cli
# pnpm / yarn
pnpm add -g pdf2markdown-cli
yarn global add pdf2markdown-cliOr use without installing:
npx -y pdf2markdown-cli document.pdf -o output.mdAfter global install, both pdf2markdown and pdf2md are available.
One-shot setup (install, auth, and skills):
npx -y pdf2markdown-cli init -yQuick start
Get your API key from pdf2markdown.io/dashboard.
Login:
pdf2markdown login # or pdf2markdown login --api-key "p2m_live_xxxx"Convert a document:
pdf2markdown document.pdf -o output.md pdf2md document.pdf -o .pdf2markdown/output.md
Commands
Use pdf2markdown or pdf2md (same CLI):
| Command | Description |
| -------------- | ------------------------------------ |
| parse | Sync parse (files up to ~30MB) |
| parse-async | Async parse for large files (100MB) |
| login | Authenticate with API key |
| logout | Clear credentials |
| status | Show version and auth status |
| init | Install CLI, auth, and skills |
| setup skills | Install skills for AI coding agents |
| setup skills --agent <name> | Install to specific agent |
Examples
Both pdf2markdown and pdf2md work the same:
# Shorthand: file as first argument
pdf2markdown document.pdf -o output.md
pdf2md document.pdf -o .pdf2markdown/output.md
# From URL
pdf2markdown parse --url "https://example.com/doc.pdf" -o doc.md
# Multiple files
pdf2markdown parse file1.pdf file2.png -o .pdf2markdown/
# Large file (async) — submit and wait
pdf2markdown parse-async large.pdf --wait -o output.md
# Or step by step: submit → status → result
pdf2md parse-async large.pdf
pdf2md parse-async task_xxx --status
pdf2md parse-async task_xxx --result -o output.mdSupported formats
PDF, JPEG, PNG, GIF, WebP, TIFF, BMP
Testing
pnpm run build
pnpm run testSee TESTING.md for details.
