pages

A command interface for controlling Apple Pages, Apple’s document-creation app, from an agent. It can create, open, inspect, export, template, close, and check the status of documents.

In plain words
What is it for?
It helps create blank or template-based documents, open files, view page and word-count information, export documents as PDFs, close them, and check their status.
Why use it?
It removes the need to perform these basic Pages actions manually through the app while working with an agent.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/marcelrgberger/pages-cli/pages
Clone the repo
git clone --depth 1 https://github.com/marcelrgberger/pages-cli
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 703 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00038 $0.00703
Opus 5 $0.00019 $0.00351
Sonnet 5 $0.00008 $0.00141
Haiku 4.5 $0.00004 $0.00070

Measured 2d ago against content hash a728c9eab81b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pages scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/pages.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pages CLI — Quick Access

You have access to the Apple Pages CLI (pages-cli).

Step 0: Ensure CLI is available

Check if pages-cli is installed. If not, install it automatically:

which pages-cli || (cd ${CLAUDE_PLUGIN_ROOT}/agent-harness && python3 -m venv .venv && source .venv/bin/activate && pip install -e . && echo "pages-cli installed")

If a venv already exists, activate it:

test -f ${CLAUDE_PLUGIN_ROOT}/agent-harness/.venv/bin/activate && source ${CLAUDE_PLUGIN_ROOT}/agent-harness/.venv/bin/activate

Your task

Parse the argument $ARGUMENTS and execute the matching action:

If no argument or "new":

  1. Create a new blank document:
    pages-cli --json document new
    
  2. Inform the user and wait for instructions on what to do with it.

If "new ":

  1. Create a document from the named template:
    pages-cli --json document new --template "<template name>"
    
  2. Inform the user and wait for instructions.

If "open ":

  1. Open the document:
    pages-cli --json document open "<path>"
    
  2. Get document info:
    pages-cli --json document info
    
  3. Show the user a summary (name, pages, word count) and wait for instructions.

If "info":

pages-cli --json document info
pages-cli --json text word-count

Display the information in a clear format.

If "close":

pages-cli document close

If "export pdf " or "export word " etc.:

pages-cli export <format> "<path>"

Confirm the export with file size.

If "templates":

pages-cli --json template list

Display the templates grouped by category (Reports, Letters, CVs, etc.).

If "status":

pages-cli --json session status

After opening/creating

Once a document is open, translate the user's natural language into CLI commands:

  • Write text → pages-cli text add "..."
  • Format text → pages-cli text set-font --name "..." --size N
  • Add table → pages-cli table add --rows N --cols N
  • Add image → pages-cli media add-image "path"
  • Export → pages-cli export pdf/word/epub "path"
  • Review → pages-cli --json text get → Analyze the text and suggest improvements
  • Check formatting → pages-cli --json document info → Check consistency

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 99 lines · 38 tokens per session scan A a728c9eab81b

Subscribe to this mod's changes

pages is a command published in the GitHub repository marcelrgberger/pages-cli (14 stars, last pushed 5mo ago), licensed MIT. It adds 38 tokens to every session and 703 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.