Paged.The open publishing system
The technical handbook
Command line (paged)

Paged Docs / Command line (paged)

The paged command from npm

The `paged` command and its `paged mcp` server, installed from npm as @paged-media/paged — no Rust toolchain, Node 22 or later, or Bun.

Tier: IntermediateIntermediateIIhow-to

Reviewed against engine v0.74.2

In short @paged-media/paged on npm is the engine as wasm and a paged command over it. Run it with npx; it needs Node 22 or later, or Bun, and no Rust toolchain. paged mcp serves the engine to an MCP client over stdio.

Run it

npx @paged-media/paged --help
npx @paged-media/paged get brochure.idml 'swatch[name=Black]'
npx @paged-media/paged set brochure.idml page:#1 itemName Cover -o out.paged
npx @paged-media/paged export brochure.idml -o brochure.pdf

Installed into a project (npm install -D @paged-media/paged), the bin is npx paged. Its verbs read and write any property the engine or an installed plugin bundle publishes, run paged.* scripts, and export .paged, .idml and .pdf. The engine it drives is the package's own wasm, the same one the editor runs. The Rust command line is a separate program over the same engine; its reference lists that binary's commands.

paged mcp: the engine for agents

paged mcp is an MCP server over stdio (one JSON-RPC message per line). Add it to an MCP client's server list; nothing is deployed:

{
  "mcpServers": {
    "paged": { "command": "npx", "args": ["-y", "@paged-media/paged", "mcp"] }
  }
}

It serves the same tools, with the same names and schemas, as the Rust paged mcp:

  • A library of documents on disk (--library <dir>, default $PAGED_LIBRARY, else ~/.paged/library), each a repository of versions and branches: list_documents, describe_document, read_part, history, diff, create_branch, commit_parts, propose_change, list_changes, download_link.
  • The engine: open_document, run_script (paged.* scripts), render_page (a PNG) and save_document.
  • The capability catalog: lookup_api.

An agent's writes land on agent/<run>/… branches with provenance, for the library's owner to merge.

Templates

paged template fields | kinds | fill | check lists a template's fields and the module field kinds the loaded modules offer, fills the fields as a filler and writes .paged, .idml or .pdf, and checks that a submitted document changed nothing outside its fields: paged template. It ships with the next release.

Batches, preflight and packages

On main, for the next release:

  • paged generate <template> --data <file> --out <dir> --per record|group writes one document per record or per group of records: paged generate.
  • paged preflight <doc> runs the PDF exporter's checks and exits 1 on an error finding; paged package <doc> -o <dir|x.zip> collects the IDML, its links, its fonts, a report and the .paged into one folder: preflight and package.
  • Every PDF the command writes (export, template fill -o x.pdf, merge, generate, package --pdf) goes through paged.publish's typed exportPdf when that module is loaded, so it is the PDF the editor's Export dialog makes; export --core keeps the engine's own door, and export --option key=value passes the exporter's other options (bookmarks, tagged PDF, …).

Typed commands, bytes and other formats

On main, for the next release:

  • paged commands [doc] lists every typed command the engine and the loaded modules offer, with its argument schema; paged invoke <doc> <command> <args> runs one (Module commands).
  • A bytes argument is given as "@path", { "$file": "path" } or { "base64": "…" }, and --result-out <file> writes the bytes a command answers (an exported file).
  • A document that is not .paged or .idml opens through the importer of a loaded module that claims its extension (.pptx, .xlsx, .pdf, .html, …), onto a new blank document, as the editor's File ▸ Open does. A .docx opens as a document of its own, a page per section, as it does in the editor.

Plugins

Plugin bundles are found where the command runs: --plugins <a,b> loads those; otherwise every installed dependency of the current directory's package.json that declares a paged manifest. The built-in modules (sheet, draw, image, data, publish, …) are part of the editor and are not on npm, so commands that need one — apply, merge and generate (paged.data), preflight (paged.publish), a module's typed commands — report that it is not loaded. In a checkout of paged-media/paged the modules are workspace packages, and --plugins names them by package name or path. package needs no module.

The package's other entries

ImportWhat it is
@paged-media/pagedthe editing canvas: the wire types, the document model and WebGPU rendering.
@paged-media/paged/introspectread-only introspection (Inspector) and the static capability catalog.
@paged-media/paged/repothe document repository: versions, branches and releases.

To show a document read-only, the Viewer SDK (@paged-media/viewer) is the small package. To write an extension, the Plugin SDK (@paged-media/plugin-sdk).

On this page