Home / Skills / genspark-ai/genoffice

genoffice

Create, convert, read and edit Office documents locally with GenOffice's command line. Build a new presentation (pptx) from a brief through a checked outline, per-page spec and render pipeline, a new spreadsheet (xlsx) from CSV or JSON data with formulas, a new Word document (docx) from Markdown or HTML, or a PDF; convert between pdf, docx, xlsx, pptx, md, html and csv; read the structure and text

skillLicense: Apache-2.0 Source: genspark-ai/genoffice

Install

Copy this folder into your Claude Code project (needs Node.js):

npx degit genspark-ai/genoffice/skills/genoffice .claude/skills/genoffice

Or install it for every project:

npx degit genspark-ai/genoffice/skills/genoffice ~/.claude/skills/genoffice

File content

Made by its original authors and shared under Apache-2.0. We show it unchanged, with credit and a link to the source. Source ↗

---
name: genoffice
description: Create, convert, read and edit Office documents locally with GenOffice's command line. Build a new presentation (pptx) from a brief through a checked outline, per-page spec and render pipeline, a new spreadsheet (xlsx) from CSV or JSON data with formulas, a new Word document (docx) from Markdown or HTML, or a PDF; convert between pdf, docx, xlsx, pptx, md, html and csv; read the structure and text of an existing file (including the user's own docx / xlsx / pptx as source material) and apply structured edits to it. Use whenever the user asks for a slide deck, presentation, spreadsheet, workbook, report, Word document or any real Office file, a format conversion, a rewrite of part of an existing document, or wants the result opened in the GenOffice editor. Documents are processed locally; only search, image and media send the query or the referenced file to the provider configured in GenOffice.
metadata:
  version: 2.68.0
  cli: '>=0.9.0'
---

# genoffice — GenOffice from the terminal

`genoffice` is installed with GenOffice. Run `genoffice --version` first. If the command is not found, GenOffice writes the launcher directory to `~/.genoffice/launcher` (Windows: `%USERPROFILE%\.genoffice\launcher`) on every start: read that one line and run `"<dir>/genoffice"` from bash or `"<dir>\genoffice.cmd"` from PowerShell / cmd, quoted, in place of `genoffice` below. Default locations when that file is missing: macOS `/Applications/GenOffice.app/Contents/Resources/cli`, Windows `%LOCALAPPDATA%\Programs\GenOffice\resources\cli`, Linux `/opt/GenOffice/resources/cli`. Every command runs headless on the app's own engines; only `search`, `image` and `media` send data off the machine, to the provider configured in GenOffice.

Always add `--json` when a program reads the output: one JSON object on stdout, `{ "status": "ok" | "partial", "command", "summary", "output_path"?, "warnings"?, "detail"? }` (`partial`: an `apply` with `--best-effort` / `--stop-on-error` wrote the file but lost ops) or `{ "status": "error", "code", "error", "message", "suggestion"?, "detail"? }`. Exit codes: `0` ok, `1` usage or rejected ops, `2` file not found / output exists / file open in GenOffice, `3` conversion failed, `4` app not available. `error` is the machine-readable reason (table under "When a command fails"), `suggestion` the next step in one sentence, including `did you mean "…"?` when a command, option, op name, element id or sheet name is one typo away. `detail` carries facts as fields (`failures[]` with `index`, `op`, `error`, `reason`, `valid_range`, `available`, `supported`, `usage`; `sheets`, `options`, `commands`); never parse `message`.

## Commands

| Command                                                                                                                                                                                                                                                          | What it does                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `genoffice info <file> [--password <pw>]`                                                                                                                                                                                                                        | Metadata and structure summary (docx blocks and headings, pptx slides, xlsx sheets, pdf pages)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `genoffice convert <file> --to <fmt> [--out <path>] [--force]`                                                                                                                                                                                                   | `pdf→docx/pptx/xlsx`, `csv→xlsx`, `xls/xlsb/ods→xlsx`, `md→docx/html`, `docx→html/md`, `html→docx`, `xlsx→csv` (`--sheet`), and `docx/xlsx/pptx/md/html→pdf`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `genoffice create --type pptx --ops <file> --out <path>`                                                                                                                                                                                                         | New deck from a list of slide ops                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `genoffice create --type pptx --spec <dir\|file> [--outline <file>] --out <path> [--render [dir]] [--audit]`                                                                                                                                                     | New deck from page spec files (one per slide, name order) or one deck spec file: px-positioned text, shapes and images (the designed-deck path, see below)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `genoffice create --type xlsx --from <data.csv \| table.json> [--header] [--decimal ,] --out <path>`                                                                                                                                                             | New workbook from CSV or a 2-D array / `{sheets:[{name,rows}]}`; `"=..."` cells are formulas; `--header` freezes row 1 and filters the range                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `genoffice create --type docx --from <text.md \| fragment.html> --out <path>`                                                                                                                                                                                    | New Word document from Markdown or a restricted-HTML fragment                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `genoffice create --type pdf --from <document> --out <path>`                                                                                                                                                                                                     | PDF printed by the GenOffice renderer from any md/html/docx/xlsx/pptx file                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `genoffice slides read <pptx> [--slide n] [--full \| --max-chars n] [--layouts] [--units in\|cm\|pt\|px]` / `genoffice slides apply <pptx> --ops <file> [--dry-run]`                                                                                             | Inspect ids, geometry (`box` and `size` in EMU, or converted with `unit` named when `--units` is given) and text previews (clipped to 300 characters, ending in `…(+n chars)` with `truncated: true`; `--max-chars` moves the cap, `--full`: whole text, every table row, speaker notes), then edit with ops Text elements carry `effective` (first run's font size/family/color/bold/italic and paragraph align) with `src` naming where each value comes from: `run`, `paragraph defRPr`, `shape lstStyle`, `layout placeholder`, `master placeholder`, `master titleStyle`/`bodyStyle`, `presentation defaultTextStyle`, `theme major`/`minor`; `setFont` writes the run level and overrides all of them, `applyTheme` changes the theme fonts and colors. Elements with a hyperlink carry `link` (`url`, `slide` jump or a PowerPoint `action`: `nextslide` / `previousslide` / `firstslide` / `lastslide` / `lastslideviewed` / `endshow`); `setLink` and `setText` run `link` fields write the same three kinds.                                                                                                                                                      |
| `genoffice slides audit <pptx> [--slide n]` / `genoffice slides render <pptx> --out <dir> [--scale 2]`                                                                                                                                                           | Geometry audit (`out_of_bounds`, `off_slide`, `text_overflow`, `text_overflow_width`, `overlap`, `picture_distorted` = box aspect off the cropped source by >5%): `issues[]` with a `code`, `level`, `path` (`s_n/e_*`) and, except for overlap, a `suggest` `setTransform` op you can pass to `slides apply` as is; one PNG per slide to look at                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `genoffice render <file> --out <dir> [--page n] [--scale 2] [--el e_12 [--pad px]] [--grid [--cols 4] [--tile 320]]`                                                                                                                                             | One PNG per page of a docx, xlsx, pptx, md, html or pdf file, laid out by the GenOffice renderer: look at it before reporting a document or workbook as done; `--el` (pptx) also writes the page cropped to one element (`<stem>-NN-e_12.png`, ids from `slides read`) so a small box is legible; `--grid` also writes every page onto one contact sheet (`<stem>-grid.png`, row-major, tile positions in `grid.tiles`) to see a whole deck at once                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `genoffice slides check <outline.json\|page.json>` / `genoffice slides replace <pptx> --slide n --spec <page.json>`                                                                                                                                              | Validate a deck outline (exit 1 on errors) or build-and-audit one page file and check it against its outline entry and style.md; rebuild one slide from its page file, other slides untouched                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `genoffice sheet read <xlsx> [--sheet name] [--range A1:D20] [--cols A,C:E] [--max-rows n] [--where formula\|error\|empty\|number\|text] [--stats] [--formats]` / `genoffice sheet apply <xlsx> --ops <file> \| --cells <file>` / `genoffice sheet check <xlsx>` | Read a range plus `features` (panes, filter, charts, tables, rule counts for the sheet; merges and links in the range; `--formats` adds cell formats, widths, heights); keep the output small with `--cols` (only those columns, named in `columns`), `--max-rows` (`rowsShown` / `rowsTotal` and a `note` with the `--range` to continue), `--where` (only cells of one kind as `{ref, value, formula}`, no grid) or `--stats` (counts, used range and the sheet list, no cells); edit with the workbook DSL or by cell address; `check` lists formula errors, references to missing sheets, broken defined names, chart ranges off the data, `###` columns (with a `set_col_width` suggestion), placeholder text and existing rules                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `genoffice sheet links <xlsx> [--update] [--break indices]`                                                                                                                                                                                                      | External `[n]` links: list them (stored path, resolved path, whether the file exists, source sheet names); `--update` re-reads reachable sources and writes the computed values as the formulas' cached `<v>` (formula text untouched; unreachable links keep their cache); `--break indices` turns those formulas into their cached literals, removes the links' parts and renumbers the surviving `[m]`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `genoffice docs read <docx> [--range a-b] [--html] [--full \ / `genoffice docs compare <original.docx> <revised.docx> --out <redline.docx> [--author name] [--date <iso>] [--granularity word                                                                    | char] [--ignore formatting,case,whitespace]`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | --max-chars n] [--comments] [--revisions] [--header-footer] [--sections] [--fields] [--notes] [--properties]`/`genoffice docs apply <docx> --ops <file> [--dry-run]`/`genoffice docs check <docx>`; `compare` writes the redline of two documents — the revised one with the differences as tracked insertions and deletions (`--author`, `--date`, `--granularity word | char`, `--ignore formatting,case,whitespace`), which `--json` reports as counts | Read blocks by index (previews are clipped to 200 characters and end in `…(+n chars)` with `truncated: true`; `--max-chars` moves the cap, `--full` lifts it; plus comment threads, tracked changes, header/footer text, page setup per section, fields with their cached results, footnotes/endnotes, document properties), then edit with ops (incl. `set_properties` for the core/app/custom document metadata — custom values may be strings, numbers or booleans, an existing typed property keeps its vt type (i4/i8/r8/bool/filetime/date) when the value fits, and `--properties` also reports each custom value's `customTypes`; a `create --type docx` file carries Word-like docProps/core.xml + app.xml — `wrap_content_control` / `unwrap_content_control` for block-level w:sdt controls — the read items carry `contentControl` (outermost) plus `contentControls` (outer → inner chain) and `inlineContentControls` for run-level controls, and unwrap takes a nested tag too, `applyStyle`, `insertField` for SEQ / REF / DATE / PAGE… fields, `insertBookmark`, `updateFields`), restricted HTML, `insert_image` / `insert_picture` (sized, floating) / `insert_text_box`, `insert_chart` / `edit_chart`, `set_header_footer`, `set_watermark` (text, or a washed-out picture via `image`), `define_style`, `set_page_setup` / `insert_section_break`, `add_comment` / `reply_comment` / `resolve_comment` / `delete_comment`, `accept_changes` / `reject_changes` (selector: `all`, `ids` from `--revisions`, `author`, `type`, `blockIndex`, `blockRange`, `before`; `apply --track [--author name]` records the batch's own edits as tracked changes), `insert_footnote` / `insert_endnote` / `edit_note` / `delete_note`; `--styles` lists style ids; `check` lists fields without results (a fresh TOC), references to missing bookmarks, a TOC that no longer matches the headings, missing images, empty charts or headings, level skips, placeholder text, pending tracked changes and open comments |
| `genoffice merge <template.docx\|pptx\|xlsx> --data <values.json \| inline JSON> --out <path> [--force] [--strict]`                                                                                                                                              | Fill `{{key}}` placeholders in a Word, PowerPoint or Excel template from a JSON object (nested objects flatten to dotted keys `a.b`; whitespace inside the braces is tolerated) through the engines' own find/replace (Word, PowerPoint: text, tables, speaker notes) and typed `set_cell` writes (Excel: a whole-cell placeholder takes the value's type, a number stays a number; substituted text stays text even when it starts with `=`). `detail.used_keys`, `detail.unused_keys` and `detail.unresolved_placeholders[]` (`{placeholder, key, reason: no_key \| split_placeholder \| unreachable_nested, location}` — block index / slide + element id / sheet + cell) tell what happened; unresolved placeholders stay in place with a `unresolved_placeholder` warning unless `--strict` makes them an error. `split_placeholder` = Word split the `{{…}}` over runs with different formatting; retype it in the template in one run (PowerPoint fills a placeholder that spans runs). `unreachable_nested` = inside a nested pptx group (or a table in a group), which deck `findReplace` does not reach; ungroup it. A Word table nothing fills is left untouched |
| `genoffice pdf read <pdf> [--page n \| --range a-b] [--password <pw>] [--full \| --max-chars n]`                                                                                                                                                                 | Text layer of a PDF page by page: 1-based `page`, `width_pt` / `height_pt`, `text` clipped to 4000 characters ending in `…(+n chars)` with `truncated: true` (`--max-chars` moves the cap, `--full` lifts it and reads every page), plus page count, `encrypted` and title / author / producer metadata; without `--page` / `--range` the first 20 pages come back and `detail.truncated` names the rest; scanned pages have empty text (`convert --to docx` runs OCR)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `genoffice guide <slides\|docs\|sheets> [group\|op\|design\|spec] [--json] [--index] [--fingerprint]`                                                                                                                                                            | The op reference for each domain, generated from the same definitions `apply` validates against (read this before writing ops); one group or one op with its JSON schema on request; `slides design` / `slides spec` for building a deck                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `genoffice search <query> [--images] [--max n]`                                                                                                                                                                                                                  | Web / image search via the provider configured in GenOffice; `detail.results[]` `{title,url,snippet}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `genoffice image <prompt> [--out f.png] [--aspect 16:9] [--ref a.png,b.png] [--model <name>]`                                                                                                                                                                    | Generate an image with the configured provider and save it; `detail.mime`, `output_path`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `genoffice media <file\|url> [--ask <question>]`                                                                                                                                                                                                                 | Describe / question an image, video or audio file; answer in `summary` and `detail.text`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `genoffice capabilities`                                                                                                                                                                                                                                         | Which cloud features are configured in GenOffice (search, image search, image generation, media analysis) and whether the app is installed; no network call                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `genoffice open <file> [--slide n [--el e_12] \| --block n \| --range [Sheet!]B2:D5 \| --page n]`                                                                                                                                                                | Open the file in the GenOffice app (only when the user asks to see it there); with a target, also scroll to and select that slide element / block / range / page so the user is looking at the same spot you are (`target_not_found` / `out_of_range` come back with the valid ids or range)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `genoffice selection <file> --json`                                                                                                                                                                                                                              | What the user has selected in the editor showing the file: `{slide, elements[], types[]}`, `{blocks:[a,b], text, collapsed}`, `{sheet, range, values?}` or `{page, text?}` — resolve "this one" / "here" from it before editing; `file_not_open_in_gui` when no tab shows the file                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `genoffice skill list` / `genoffice skill install <agent\|all> [--dir <path>] [--force]` / `genoffice skill path`                                                                                                                                                | Skill install targets found on this machine with the skill version each has — one row per tool that scans its own folder (Claude Code, Windsurf, OpenClaw) plus the shared `.agents` row that Codex, Cursor, Gemini CLI, Copilot, OpenCode, dsh and the like read; copy or update this skill into a skills directory, or print the bundled SKILL.md; nothing is installed without this command or a click in Settings → Integrations                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

`--ops -` and `--cells -` read stdin. `--out` defaults to the input file's folder with the new extension (`convert`) or edits in place (`apply`). Unknown options are rejected (exit 1). The `mcp` server runs on stdio by default; `mcp [--http <port> [--host <addr>] [--token <secret>]]` serves Streamable HTTP instead; `genoffice mcp install <agent|all> [--dir <path>] [--force]` registers the stdio server in a coding agent's MCP config (`mcp uninstall <agent>` removes it, `mcp list` shows each agent).

`genoffice mcp` as an MCP client sees it:

- Tools mirror the commands one-to-one (`info`, `convert`, `create_docx` / `create_xlsx` / `create_pptx` / `create_pdf`, `docs_read` / `docs_apply` / `docs_check`, `sheet_read` / `sheet_apply` / `sheet_check`, `slides_read` / `slides_apply` / `slides_audit` / `slides_render` / `slides_check` / `slides_replace`, `render`, `guide`, `capabilities`, `search`, `image`, `media`, `open`, `selection`); ops, cells, specs and Markdown go inline, results are the `--json` envelope (a `partial` batch is not `isError`, its first text block lists the lost ops), `open` and `selection` exist on stdio only.
- `deck_start` / `deck_page` / `deck_build` / `deck_replace` are the staged deck flow above with the deck folder as state; a short deck with concrete content is one `create_pptx` call.
- The op references are resources: `genoffice://guide/docs`, `…/sheets`, `…/slides`, `…/slides/design`, `…/slides/spec`.
- `ops`, `cells` and `data` carry the per-op schema of `guide <domain> --json` (one variant per op: `op`, fields, required); `mcp --compact-schemas` (or `GENOFFICE_MCP_COMPACT_SCHEMAS=1`) advertises plain arrays for clients with a small context budget.
- `--http`: files travel with the calls (`PUT /files/<name>` uploads one and returns a URL, every path parameter also takes an http(s) URL, `out` omitted returns the file as a download URL).
- The GenOffice app runs its own MCP server on `127.0.0.1:3093` (Settings → Integrations) whose tools (`create_session`, `read_document`, `apply_ops`, `apply_slide_ops`, `apply_sheet_ops`, `read_pdf`, `read_docx_properties`, `open_documents`) edit the documents already open in the visible editor (`sheet_links` instead maintains an on-disk workbook's external links); `genoffice mcp` works on files on disk.

## Which command

| Task                                                       | Command path                                                                                                                                   | Not for                                                                                  |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| A presentation from a brief, however short                 | `guide slides design` → `style.md` + `outline.json` → `slides check` per page → `create --type pptx --spec` → `render --grid` → `slides audit` | editing a deck that exists (`slides apply`); a fixture deck (`create --type pptx --ops`) |
| Change text, a picture or one slide of an existing deck    | `slides read` → `slides apply --ops` → `slides audit` → `render --page`                                                                        | restyling the whole deck (`applyTheme` op, or rebuild through the staged path)           |
| A workbook from data                                       | `create --type xlsx --from data.csv \| table.json` → `sheet apply --ops` for formats/charts → `sheet check`                                    | one cell fix in an existing file (`sheet apply --cells`)                                 |
| Edit cells, formats, charts, rules of an existing workbook | `sheet read` → `guide sheets <op>` → `sheet apply --ops` → `sheet check`                                                                       | `refresh_pivot`, session tables and shapes (refused: needs the editor)                   |
| A Word document from text                                  | `create --type docx --from report.md \| fragment.html` → `docs check` → `render`                                                               | a real web page (`convert page.html --to docx`)                                          |
| Edit an existing Word document                             | `docs read` → `docs apply --ops` → `docs check`                                                                                                | reading its text (`convert --to md` or `docs read --full`)                               |
| Read the user's file as source material                    | `convert --to md/csv` or `<domain> read --full --json`                                                                                         | `unzip`/`cat` on the Office file; `render` (pixels, not text)                            |
| Change the file format                                     | `convert <file> --to <fmt>`                                                                                                                    | any content change (edit first, convert after)                                           |
| See what a page looks like                                 | `render` (`--page`, `--el`, `--grid`)                                                                                                          | extracting text or ids (`read`)                                                          |
| Point the user at a spot, or act on what they selected     | `open <file> --slide/--el/--block/--range/--page` → `selection <file> --json`                                                                  | reading content (`read`); files the user has not opened (`selection` needs the tab)      |
| Look up op fields                                          | `guide <domain> [group\|op] [--json]`                                                                                                          | guessing from this file: the guide is generated from the validator and is always current |
| Give another agent (or a fresh machine) this skill         | `skill list` → `skill install <agent>` (or `skill path` and copy the file)                                                                     | writing the skill by hand; `install-cli` (that puts `genoffice` on the PATH)             |

## Behaviour to know

- **Word (`docs`)**: block indexes inside one batch are live — after `insert_content` adds two blocks, later indexes shift by two. A target that matches no block fails the whole batch (exit 1). `findReplace` does not reach table cells (use `replace_blocks` on the table). Tags outside the restricted set are stripped silently. `convert docx→md` writes GFM: `& < >` become entities, formulas become `$…$`, images are dropped and counted in `detail.skipped`. `create --from x.md` embeds local images referenced by relative path. `insert_image` takes a local path (relative to the current directory, then to the ops file), a data: URL or an http(s) URL (png/jpg/gif) and appends unless `afterBlockIndex` is given; `edit_chart` targets blocks `docs read` lists with kind `chart`; `set_header_footer` writes plain text with `{PAGE}` / `{NUMPAGES}` tokens, `view: "first"` switches the different-first-page setting on; comment ids come from `docs read --comments`; `add_comment` anchors a new thread to a block or to an exact `text` span inside it (`occurrence` picks one of several matches) without touching the document text; `delete_comment` on a thread root with replies needs `withReplies: true`; revision ids (`r1`, `r2`, …) come from `docs read --revisions` and are positional, so read again after any edit before `accept_changes` / `reject_changes`. `insertField` computes SEQ numbers, REF text, DATE and MERGEFIELD locally; PAGE / NUMPAGES / AUTHOR-style results are placeholders Word recomputes on open (`docs check` reports them as info), so say so when you hand over the file. Note ids for `edit_note` / `delete_note` come from `docs read --notes`; `edit_note` is `findReplace` inside one note (`{ id, find, replace, matchCase? }`, `kind` only when a footnote and an endnote share the id) and keeps the note's id, reference mark and formatting — `findReplace` itself never reaches note text. `remove_parts` scrubs metadata-carrying package parts before a filing (`kinds: ["customXml"]` / `["webExtensions"]` / both, or explicit package-relative `paths`); the removed parts' relationships, [Content_Types].xml entries and empty folders go with them and every other part keeps its bytes, and content controls bound to a removed customXml store refuse the batch unless `dataBinding: "strip"` unbinds them (the control and its current text stay). `define_style` patches only the fields given (an existing style keeps the rest); `applyStyle` takes a paragraph style id from `docs read --styles` and turns blocks into headings when the style is a heading style; `set_watermark` with `text: null` removes the watermark; `insert_picture` / `insert_text_box` lengths take `2.54cm` / `1in` / `72pt` / `96px` or points. `set_page_setup` changes paper / orientation / margins / columns / titlePg / page numbering of every section or of one (`section: N` or `blockIndex`), lengths as `"2.54cm"` / `"1in"` / `"72pt"`; `insert_section_break` splits a section after a block (the copy is then changed with `set_page_setup section: N`); `docs read --sections` lists sections with their block ranges. Native tables take structure ops: `insertTableRow` / `deleteTableRow` / `insertTableColumn` / `deleteTableColumn` (0-based, `position: "before"|"after"`, `count`), `mergeTableCells` / `splitTableCell` (grid `range` / `cell`; a merge that cuts an existing merged cell is refused), `setTableCellFormat` (fill, vAlign, borders, `width` in twips or `"2.5cm"`), `setTableStyle` (a style id from `docs read`'s `tableStyles`, plus look flags); target them with `nodeType: "table"` and `docs read` shows each table's `rows`, `cols` and `merged` cells.
- **Excel (`sheet`)**: ops run in order, each seeing the previous result: after `insert_rows`/`delete_cols` the following ops address the shifted grid (a formula written after the shift is stored as given, one written before it is shifted like the existing ones), a sheet added or renamed earlier in the batch is addressed by its new name; rules, links, notes, filters and visuals must come after any row/column op on their sheet, and defined-name ops cannot share a batch with sheet or row/column ops. `set_cell` with a string starting with `=` writes a formula; `type: "text"` keeps it literal text. Beyond cells, `sheet apply --ops` writes charts (`add_chart`, `edit_chart` on `xl/charts/chartN.xml`), images and shapes, Excel tables, freeze panes, hidden rows/columns, filters with checked values, conditional formats, data validation, hyperlinks, notes, page setup, sheet protection, defined names and tab order/visibility (`genoffice guide sheets` has every field). `--cells` `style` takes the same object as `format_range.format` (`{bold, fillColor, numberFormat, …}`). Colors are `#RRGGBB` or theme slots that follow the workbook theme: `"accent1"`, `"accent1+40%"` (lighter), `"dk2-25%"` (darker) or `{theme, tint}`; `fill: {pattern: "lightGray", fg, bg?}` or `fill: {gradient: {angle, stops: [{position, color}]}}` writes pattern and gradient fills, and `--formats` echoes them back with the slot, tint and resolved rgb. `sheet read` returns raw values (0.25, serial dates) and formulas separately, `features` (sheet-wide panes, filter, charts, tables and rule counts; merges and links of the range), and with `--formats` the styled cells, column widths (px) and row heights (pt); `convert --to csv` returns the displayed text (percent, dates), UTF-8 with BOM, CRLF line ends, active sheet unless `--sheet`. `create --from x.csv`: a `sep=;` first line is honoured, ISO dates (`2024-01-01`, `2024-01-02 09:30`) become real dates with a date format, `--decimal ,` reads `1.234,5` as 1234.5. Formulas using functions the local engine cannot evaluate (FILTER, SORT, UNIQUE, LET, …) are written without a cached value and Excel computes them on open; spill formulas are stored as dynamic arrays so they spill in Excel 365; the `formulas_not_cached` warning names those cells.
- **PowerPoint (`slides`)**: picture ops (`addPicture`, `replacePicture`, `addMedia`, `setImageFill`, `setBackground`) take a local path or data URL in `bytes`; the extension is inferred. `setText` runs inherit the element's first run style unless a field is set explicitly (`bold: false`). Ops in one `apply` batch run in order, so a later op may target a slide an earlier op added; atomic still writes nothing unless every op applied; `--best-effort` (formerly `--isolation per_op`) and `--stop-on-error` write what applied and answer `status: "partial"`. Created elements get new `e_*` ids: run `slides read` again before targeting them. `convert pptx→pdf` is rendered like the app's export: one bitmap per slide, no text layer. Every EMU length field (`box`, `offset`, `dx`/`dy`, `wEmu`/`hEmu`, `colWidthsEmu`, `insets`) also takes a string with a unit suffix: `"2.54cm"`, `"1in"`, `"10mm"`, `"12pt"`, `"96px"`. `slides read` lists each page's `animations[]` (`seq`, `el`, `effect`, `kind`, `trigger`, `durationMs`, `delayMs`, `direction`); `addAnimation` / `removeAnimation` / `reorderAnimation` edit one timeline item (`presetXml` passes a PowerPoint-exported effect through verbatim), `insertEquation` adds a typeset formula from LaTeX (PowerPoint renders it, previews show the linear text).
- **Conversions in the app** (`→pdf`, `docx→html`, `html→docx`, `create --type pdf`, `render`): a hidden GenOffice process per call, 1–6 s, up to 180 s timeout, safe to run concurrently. `html→docx` is html2docx for real web pages; a restricted-HTML fragment with `<formula>` goes through `create --type docx --from fragment.html` instead.
- **Cloud (`search`, `image`, `media`)**: `--images` returns `detail.images[] {title,imageUrl,sourceUrl,source,width,height}`; providers may return fewer than `--max`. `image` saves with the provider's real format (`output_path` tells you; a `.png` request may come back `.jpg`, noted in `detail.note`); `--aspect` / `--size` are validated locally.

## Workflow

1. `genoffice info` or `genoffice <domain> read --json` to learn the structure: block indexes (docx), `s_<n>` / `e_*` ids and EMU geometry (pptx), sheet names and cell values (xlsx).
2. `genoffice guide <domain>` for the op fields (`guide <domain> <op> --json` for one op's schema), then write the ops JSON yourself.
3. `genoffice <domain> apply --dry-run` when the batch is large; a rejected op comes back as `op_rejected` with the executor's usage line — fix that op and resend the whole batch. Atomic by default: on rejection the file is untouched and `detail.batch` is `{total, applied: 0, failed, skipped}`. `--best-effort` applies every op that can apply, `--stop-on-error` applies in order up to the first rejection; both write the file and answer `status: "partial"` (exit 0) with the lost ops in `detail.failures` and the counts in `detail.batch` — a program must check `status`, not only the exit code.
4. The QA gate below, then report the output path.

## Pitfalls

| Pitfall                                                                                                                                                                             | Rule                                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `slides read/audit/render/replace --slide n` and op targets `{ "slide": n }` are **0-based**; `render --page n` is **1-based**; docx block indexes are 0-based                      | `s_0` is page 1 of the PNGs.                                                                                                                                   |
| `--ops -`, `--cells -` and `--spec -` read stdin (`--from` does not); any other value must be an existing file                                                                      | A path that does not exist is `file_not_found`, not an empty batch.                                                                                            |
| Structural edits renumber: new `e_*` ids after `addElement`, `s_*` after adding slides, docx block indexes after `insert_content`/`delete_blocks`                                   | Inside one batch indexes are live (later ops see earlier results); before the next batch run `read` again.                                                     |
| EMU fields (`offset`, `box`, `dx`/`dy`, `wEmu`/`hEmu`, `colWidthsEmu`, `insets`) take integers or unit strings `"2.54cm"`, `"1in"`, `"10mm"`, `"12pt"`, `"96px"`                    | Do not multiply by 914400 yourself; `slides read` returns EMU integers.                                                                                        |
| CSV import: a `sep=;` first line is honoured and removed, ISO dates become real dates, `--decimal ,` for `1.234,5`                                                                  | `--header` freezes row 1 and adds a filter; without it the first row is data.                                                                                  |
| Formulas the local engine cannot evaluate (FILTER, SORT, UNIQUE, LET, LAMBDA …) are written without a cached value                                                                  | `formulas_not_cached` warning lists them; `sheet read` shows the formula and no value until Excel opens the file. Not an error.                                |
| `sheet apply` addresses sheets by the **current tab name in the file**, spelled as in the tab                                                                                       | `sheet_not_found` carries `detail.sheets` and a `did you mean`.                                                                                                |
| Structural sheet ops (insert/delete rows, columns, sheets) shift the addresses of the ops af