Codumentor logo Codumentor

XLSX Editor Plugin

The XLSX Editor plugin provides Excel workbook editing (.xlsx / .xlsm) through the same dynamic tool-injection pattern as the Document Editor. The agent always has an xlsx_open tool; opening a workbook injects a full suite of editing tools, which are removed again when the workbook is closed. All workbook manipulation happens in an isolated openpyxl worker subprocess designed to run inside the Workspace Isolation sandbox.

Configuration

plugins:
  - module: codumentor.plugins.xlsx_editor
    class: XlsxEditorPlugin
    args:
      enabled: true
      target_agents: "main"  # "main", "subagent", or "all" (default: "main")

Parameters

Tool Reference

Always Available

ToolDescription
xlsx_openOpen an .xlsx/.xlsm workbook (in place or as a copy), or create a new blank one. Triggers injection of the editing tools.

Injected When a Workbook Is Open

ToolDescription
xlsx_read_workbookWorkbook outline: sheets, dimensions, named ranges, tables, active sheet
xlsx_read_rangeRead a 2D range (A1 notation), formulas or cached values
xlsx_searchRegex search across sheets (up to 50 matches)
xlsx_write_cellWrite a single cell (a leading = is treated as a formula)
xlsx_write_rangeWrite a 2D array of values in one call
xlsx_list_sheetsPer-sheet metadata (dimensions, tab colour, visibility)
xlsx_create_sheet / xlsx_delete_sheet / xlsx_rename_sheetAdd, remove, or rename worksheets
xlsx_insert_rows / xlsx_delete_rowsInsert or delete rows
xlsx_insert_cols / xlsx_delete_colsInsert or delete columns
xlsx_replace_textFind/replace across the workbook, a sheet, or a range
xlsx_set_cell_formatSet a cell/range number format
xlsx_set_styleApply font, fill, border, and alignment styles
xlsx_set_propertySet a workbook core property (title, author, …)
xlsx_read_print_settingsRead per-sheet page setup, margins, headers/footers
xlsx_pythonSandboxed openpyxl access for advanced operations
xlsx_saveSave the workbook (emits a UI download card)
xlsx_closeClose the workbook (optionally saving first)

How It Works

An onPromptAssemble hook (priority 10) tracks which sessions have an open workbook. Only xlsx_open is visible until a workbook is opened; on the next turn the editing tools are injected, and they are removed again after xlsx_close. This keeps the tool set relevant to what the agent is doing — the same pattern documented for the Document Editor.

Saved workbooks are downloadable through the UI (a plugin.xlsx_editor.file_saved event renders a download card); the download endpoint is provided by the File Links plugin.

Notes