PPTX Editor Plugin
Lets the agent open, edit, and save PowerPoint presentations (.pptx / .pptm) in the conversation — or create one from scratch. Ask it to work on a deck; editing tools appear once a presentation is open, and disappear when it is closed. Saved files show a download card in the transcript (served by the File Links plugin).
Macros in .pptm files are preserved.
Configuration
plugins:
- module: codumentor.plugins.pptx_editor
class: PptxEditorPlugin
args:
enabled: true
target_agents: "main" # "main", "subagent", or "all" (default: "main")
Keep File Links enabled so download cards in the transcript resolve. Without it, save cards still render but their links 404.
Parameters
| Key | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Master switch. |
target_agents | string | "main" | Which agents get the tools: "main", "subagent", or "all". Any other value is treated as "all". |
What the agent can do
pptx_open is always available. After a presentation is open, the editing tools below appear; pptx_close removes them.
The agent can open an existing presentation from a repo, copy it to a new path before editing, or create a new deck at a path that does not exist yet. Maximum file size is 50 MB; embedded images are capped at 20 MB. Search returns at most 200 matches.
| Tool | When | Description |
|---|---|---|
pptx_open | always | Open a .pptx/.pptm presentation, or create one (create_new, optional template_path) |
pptx_read_outline | open | Per-slide outline: index, title, layout, shape count, notes |
pptx_read_slide | open | One slide: shapes (id, type, position, text, tables) and notes |
pptx_search | open | Regex search across slide text and notes |
pptx_write_text | open | Replace a shape's text (preserves run formatting by default) |
pptx_write_notes | open | Write or replace speaker notes |
pptx_replace_text | open | Find/replace across slide text and (optionally) notes |
pptx_list_layouts | open | Slide layouts on the active master |
pptx_add_slide / pptx_delete_slide | open | Add or remove a slide; add_slide can fill the layout's title and body placeholders in the same call |
pptx_move_slide / pptx_duplicate_slide | open | Reorder or copy a slide |
pptx_add_textbox | open | Add a textbox at a given position/size |
pptx_add_image | open | Embed an image from a repo path or base64 |
pptx_add_shape | open | Draw an auto-shape (rectangle, oval, chevron, …) with optional fill, outline and label |
pptx_set_shape_position | open | Update a shape's left/top/width/height |
pptx_set_text_style | open | Font size, weight, colour, typeface and paragraph alignment on a shape, paragraph or run |
pptx_delete_shape | open | Remove a shape by id |
pptx_python | open | Escape hatch: sandboxed python-pptx, no imports (see below) |
pptx_save | open | Save; transcript shows a download card |
pptx_close | open | Close; refuses over unsaved changes unless save_first or discard_changes |
While a presentation is open the agent also receives a short note describing the workflow — save before close, build with layouts rather than coordinates, treat pptx_python as a last resort. It costs nothing in conversations that never open a deck.
Creating a new deck
pptx_open(source_path="repo/decks/overview.pptx", create_new=true) creates the file instead of opening it. The path must not already exist, must end in .pptx or .pptm, and output_path is not allowed alongside create_new.
New decks are 16:9 (12192000 × 6858000 EMU). python-pptx's own default is 4:3, which is not what anyone asks for today.
Pass template_path — a .pptx, .potx or .pptm — to inherit a corporate template's layouts, theme, fonts and slide size; the template's own slides are dropped, so you get the design without the content, and the template's slide size wins over the 16:9 default. This is the right answer to "make it on brand": it beats hand-picked hex colours, which are how branded decks usually go wrong.
Saving
Nothing reaches disk until pptx_save. Every tool that changes the presentation says [unsaved — call pptx_save] in its result while there is unsaved work, and pptx_close refuses to close over it — pass save_first=true to save on the way out, or discard_changes=true to throw the edits away deliberately.
The pptx_python escape hatch
pptx_python runs sandboxed Python against the live Presentation. It is the last resort, not the default route to anything visual — colour, font size, alignment and auto-shapes all have dedicated tools.
It cannot import. The symbols below are pre-loaded in the namespace and are the complete vocabulary available; anything else is unreachable, and the rejection message names this same list back if code tries to import:
prs (the open presentation) · Emu Inches Pt Cm Mm · RGBColor MSO_THEME_COLOR MSO_LINE_DASH_STYLE · MSO_SHAPE MSO_SHAPE_TYPE MSO_CONNECTOR PP_PLACEHOLDER · CategoryChartData XL_CHART_TYPE XL_LEGEND_POSITION · PP_ALIGN MSO_ANCHOR · copy
Also blocked: exec/eval/compile/open/__import__, getattr/setattr/delattr, globals/locals/vars/dir, type/object/super, and all dunder attribute access. Set a top-level result variable to return a value; print() output is streamed back.
To list saved presentations under This conversation in the Files browser, add pptx_save to File Links' tracked_tools. The editor's own download card does not depend on that.
See also
- Document Editor and XLSX Editor
- File Links — download cards and the repo browser