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.
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.pdfInstalled 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) andsave_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|groupwrites one document per record or per group of records: paged generate.paged preflight <doc>runs the PDF exporter's checks and exits1on an error finding;paged package <doc> -o <dir|x.zip>collects the IDML, its links, its fonts, a report and the.pagedinto 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 typedexportPdfwhen that module is loaded, so it is the PDF the editor's Export dialog makes;export --corekeeps the engine's own door, andexport --option key=valuepasses 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
bytesargument 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
.pagedor.idmlopens 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.docxopens 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
| Import | What it is |
|---|---|
@paged-media/paged | the editing canvas: the wire types, the document model and WebGPU rendering. |
@paged-media/paged/introspect | read-only introspection (Inspector) and the static capability catalog. |
@paged-media/paged/repo | the 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).
Related
- On paged.media: the automation server.
Command line (paged)
The `paged` binary — open, author, render, export and verify documents from a shell, driving the same typed engine door the editor's worker uses. Generated from the binary's own parser.
paged template
The npm paged command lists a template's fields and module field kinds, fills them to .paged, .idml or PDF, checks a submission, and makes a template from XML tags.