AI agent Markdown to PDF
Your agent writes a report in Markdown. The user wants it as a PDF. One CLI command bridges the two. No Python script calling Pandoc, no LaTeX install, no headless Chrome dance.
Most agents are great at writing Markdown. It matches their training distribution and lets them think in structured prose. They're worse at delivering anything other than Markdown. The user asked for a PDF audit report and got a .md file dropped into their repo.
OpenDocs gives the agent a one-line shortcut. Run opendocs publish report.md --export pdf --json and the response is a JSON payload with a hosted URL, a PDF download URL, and metadata. The agent prints the URL, the user clicks, the PDF lands in their downloads folder.
The agent workflow
# Install once
npm install -g @opendocs.cc/cli
# Authenticate (one-time, opens browser)
opendocs login --browser
# Publish, get a shareable URL back
opendocs publish report.md --export pdf --jsonWith --json, the response is machine-parseable. The agent grabs data.exportUrls.pdf and returns it. No extra dependencies, no document-conversion libraries to install.
Why agents prefer this over Pandoc
No system dependencies. Pandoc needs LaTeX for PDF; that's a multi-GB install the agent probably doesn't have permission to run. The OpenDocs CLI is a node binary. Install once, use forever.
Output is a URL, not a file. Files don't show up nicely in chat. URLs do. The agent's response becomes "Here's your audit: [link]" instead of "I saved the PDF to ./output/report.pdf".
JSON-first.
--jsonmeans the agent can chain the result into the next step (post to Slack, attach to a Linear issue) without parsing CLI output.Re-runs are idempotent. Publish the same file twice and the URL stays the same. Useful for loops where the agent updates the doc on every code review.
Works with
Anything that runs shell commands. We have specific guides for the common ones:
Claude Code
Use OpenDocs as a CLAUDE.md skill so Claude publishes reports automatically.
Cursor
Add an OpenDocs rule in .cursor/rules so the agent hands you URLs instead of files.
Codex
The CLI is shell-callable, so Codex can publish Markdown outputs as part of any task.
OpenClaw
Add the OpenDocs SKILL.md as an OpenClaw workspace skill.
Stop having your agent dump files into your repo.
Free plan publishes up to 10 docs with PDF export included.
Sign up free