open-pdf binary:
@autono/create-open-pdfprovidesinit. Run it withnpm create @autono/open-pdf@latestfrom anywhere, no install needed.@autono/open-pdfprovides everything else (dev,build,preview,export,sync:skills). It is a dependency of every workspace, so inside a workspacenpx open-pdf <command>resolves to it. The scaffoldedpackage.jsonalso maps npm scripts:npm run dev,npm run build,npm run preview,npm run export,npm run sync:skills.
--:
-v, --version and -h, --help.
init
Create a new open-pdf workspace.
What init does:
- Copies the workspace template into the target directory:
docs/,assets/,themes/,open-pdf.config.ts, anAGENTS.mdagent guide (linked asCLAUDE.md), and the five bundled agent skills under.agents/skills/(symlinked into.claude/skills/). - Sets the package name, marks the package private, and sets
@autono/open-pdfto a caret range on the version the CLI was built against (^x.y.z). - Writes a
.gitignorecoveringnode_modules,dist,export, and.DS_Store. - Installs dependencies (unless
--no-install) and creates a git repository with a first commit (unless--no-git). Git setup is skipped automatically when the target sits inside an existing repository.
On Windows, the
CLAUDE.md link and skill symlinks are created as copies instead.dev
Start the dev server. The preview renders actual PDF bytes and updates as docs change. See Quickstart.Skills drift check
Before starting,dev compares the skills bundled in your installed @autono/open-pdf against the copies in .agents/skills/, by content hash. If any skill was added or updated upstream:
- In a terminal, it asks
Sync now? (Y/n)and runs the sync on confirmation. - In non-interactive contexts (CI, agent shells), it prints a warning telling you to run
open-pdf sync:skillsand continues.
--no-skills-check or by setting the environment variable:
Supervised process
The server runs in a supervised child process. An in-app update of@autono/open-pdf can restart the server against the freshly installed package, and restarts reuse the same port.
build
Build the workspace as a static site: the doc browser and PDF viewer, deployable to any static host.
The
build section of open-pdf.config.ts controls which UI features the built site includes (doc browser, viewer chrome, download commands).
preview
Serve the production build locally.export
Render docs to files headlessly, without a running dev server. See Export.
Each doc is written as
<out-dir>/<id>.<format>, with a per-doc line reporting size and render time:
pdf: byte-identical to the preview. Export compiles each doc with the same Vite pipeline the dev server uses (a middleware-mode server, no port), then renders through the same Takumi engine. Font paths inpageOptions.fontsare resolved from disk.docx: an editable Word file built from the same rendered node tree. The document title comes frommeta.title, falling back to the doc id. Running bands frompageOptions.headerandpageOptions.footerbecome Word headers and footers. Constructs that do not map cleanly to DOCX are reported as warnings on stderr. Upload the file to Google Drive and it converts to an editable Google Doc.
sync:skills
Sync the bundled agent skills from your installed@autono/open-pdf into the workspace.
Drift detection is hash based: each skill directory (file paths plus contents) is hashed and compared against the workspace copy in
.agents/skills/. Each skill reports one of three statuses:
added: not yet present in the workspaceupdated: present but content differs from the installed packageunchanged: identical
.agents/skills/ and symlinked into .claude/skills/ (copied where symlinks are unavailable). To pull newer skills, upgrade the package first:
open-pdf dev runs the same drift detection on startup, so most workspaces never need to call this by hand. See For agents for what the skills do.