Edit
Structured edits on existing Office files; also validate / view / read helpers.
Basics
zagens-office edit --path file.pptx --op validate --input '{}'
zagens-office edit --path file.pptx --op set_text --input-file op.json
schema edit lists all ops (~95), named consistently across pptx/docx/xlsx.
Capability highlights
| Capability | Notes |
|---|---|
upsert_slide |
Full-slide replace/append isomorphic with write pptx (long decks: skeleton write → per-slide upsert) |
preflight / auto_fix |
Cross-format preflight; auto_fix can return a replayable plan |
fit_text / avoid_overlap |
PPTX text fitting and overlap resolution |
align / distribute / snap_to_grid |
PPTX layout ops |
| Deep XLSX edits | Comments, defined names, insert/delete remap |
Trust schema edit for the full list.
Atomic batch
Multi-step edits in one batch; failures can roll back as a unit:
{
"ops": [
{ "op": "set_text", "...": "..." },
{ "op": "upsert_slide", "...": "..." }
],
"atomic": true
}
zagens-office edit --path file.pptx --op batch --input-file batch.json
Note: the outer envelope may still be ok:true on failure — check result.rolled_back:true.
Read / check helpers
| Goal | How |
|---|---|
| Delivery check | edit --op validate |
| Structure preview | edit --op view --input '{"mode":"svg"}' |
| Outline / body | read pptx|docx --mode outline|text|stats |
| Sheets | read xlsx --mode table or grid |
read / schema do not require a license. Prefer read → batch self-heal before delivery.