Skip to content

Repository files navigation

open-pdf

The PDF framework built for agents.

npm npm CI License: MIT

Your coding agent writes documents as React components. The dev server renders them to real PDF bytes on every save, so the preview in the browser is the file you ship. Click any element to see its source line and leave a comment; the agent applies it and re-renders. Export the same bytes headlessly as PDF, or as editable Word or Markdown.

openpdf.sh · Documentation · Quickstart · Discussions

Quick start

npm create @autono/open-pdf@latest my-docs
cd my-docs
npm run dev

Open the workspace in your coding agent and ask for a document. The bundled create-doc skill writes docs/<id>/index.tsx; the preview at http://localhost:5173 updates on every save.

Requires Node.js 20.19+ or 22.12+.

Updating

Inside a workspace:

npx open-pdf update

Moves @autono/open-pdf to the latest version and syncs the agent skills it ships. Your docs and config are untouched. The dev server shows an Update button when a newer version is out, which does the same thing. Restart npm run dev afterwards.

The loop

  1. Describe. Tell your agent what the document is. It runs /create-doc and writes the React.
  2. Preview. The dev server renders actual PDF bytes on every save, in well under a second.
  3. Annotate. Press i, click anything, leave a note. It lands in the source as an @pdf-comment marker.
  4. Ship. Your agent runs /apply-comments. open-pdf export writes the PDF, or --format docx / --format md for editable Word or Markdown. The viewer's Export menu does the same.

What you get

  • A preview that is the PDF. Takumi renders real PDF bytes in a web worker. No HTML approximation.
  • Click-to-source inspector. Every element knows its exact source line. Comments persist in the source, ready for an agent.
  • Real document features. HTML tables with repeating headers, page-break control, running header and footer bands, page numbers, custom fonts and images.
  • Export to PDF, Word, Google Docs, Markdown. DOCX output is real editable text, not page images.
  • Agent-native. File-based skills (create-doc, apply-comments, create-theme, ...) sync into the workspace. No MCP server. Works with Claude Code, Cursor, Codex, Gemini CLI, OpenCode, Windsurf, Zed, and anything else that reads AGENTS.md.
  • Nothing to configure. Vite, React, and TypeScript live inside the runtime. A workspace is docs/, an optional open-pdf.config.ts, and your agent skills.

A document

import { PageNumber, TotalPages, type PageOptions } from '@autono/open-pdf';

export const pageOptions: PageOptions = {
  size: 'a4',
  margin: { top: 56, bottom: 72 },
  footer: (
    <span tw="flex w-full justify-end text-[10px]">
      Page <PageNumber /> of <TotalPages />
    </span>
  ),
};

export default function Doc() {
  return (
    <main tw="flex flex-col">
      <h1 tw="text-[30px] font-bold">Hello, open-pdf</h1>
      <p tw="mt-4">This paragraph is real PDF text.</p>
    </main>
  );
}

export const meta = { title: 'Hello' };

Style with Tailwind classes via the tw prop. Content flows and the engine paginates. See Authoring for tables, pagination, fonts, images, and themes.

CLI

Command What it does
open-pdf dev Dev server with live PDF preview and inspector.
open-pdf build Static site of the viewer.
open-pdf preview Serve the production build.
open-pdf export [docs...] Render docs to export/. --format pdf (default), docx or md.
open-pdf sync:skills Sync the built-in agent skills into the workspace.
open-pdf update Update @autono/open-pdf to the latest version and sync skills.

Full flags: CLI reference · Config reference

Packages

Package Version Role
@autono/open-pdf npm Runtime: viewer, inspector, Vite plugin, open-pdf CLI.
@autono/create-open-pdf npm npm create @autono/open-pdf scaffolder and workspace template.
apps/demo private Example workspace; the dogfood target for the framework.
apps/web private openpdf.sh landing site.
docs/ docs.openpdf.sh, built with Mintlify.

Contributing

Contributions are welcome. Read CONTRIBUTING.md for the repo layout, dev workflow, and PR checklist.

pnpm install
pnpm dev:demo     # demo workspace against local core
pnpm check        # biome: format + lint
pnpm typecheck
pnpm test

Bugs and feature requests go through the issue templates. Questions and show-and-tell belong in Discussions. Please follow the Code of Conduct.

Every merge to main is a release by default: CI tags the next version, publishes both packages to npm with provenance, and cuts a GitHub Release. Merge commits containing [skip release] skip it.

Security

Report vulnerabilities privately as described in SECURITY.md. Please do not open public issues for security reports.

Acknowledgements

open-pdf started as a fork of open-slide by Yiwei Ho, keeping its agent-first architecture and retargeting it from slide decks to paginated PDFs. Rendering is powered by Takumi.

License

MIT. Contains code from open-slide © 2026 Yiwei Ho; modifications © 2026 Autono Holdings Inc.

About

CLI for agents to make beautiful PDFs.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages