OfficeCLI is a command-line Office suite aimed at AI agents: it creates, reads, and edits Word (.docx), Excel (.xlsx), and PowerPoint (.pptx) files without an Office installation. It ships as a single self-contained binary with the .NET runtime embedded, and runs on macOS, Linux, and Windows.
Documents are addressed by path rather than by XML, so an element such as /slide[1]/shape[2] can be fetched, set, moved, or removed directly. Three layers are available: semantic read views (view in text, outline, stats, issues, HTML, SVG, or screenshot form), structured element operations (get, query, set, add, remove, move, swap), and raw XPath access (raw, raw-set, add-part, validate) as a fallback. Every command supports --json with consistent schemas, and errors return structured codes such as notfound, invalidvalue, and unsupported_property along with valid ranges.
A built-in rendering engine turns a document into HTML or per-page PNG so a multimodal agent can look at the result rather than infer it from the document tree; a watch mode serves an auto-refreshing preview on a local HTTP port that updates on every mutation. Because rendering is inside the binary, it also works in CI, in Docker, and on machines with no display.
Beyond editing, merge fills {{key}} placeholders in a template from JSON data across paragraphs, table cells, shapes, headers, footers, and chart titles, while dump serialises a whole document or any subtree into replayable batch JSON that batch can apply to a new file. Resident mode keeps a document in memory across commands via named pipes, and batch mode applies many operations in one pass, rolling the whole batch back by default if an item fails.
Features
- Format coverage: read, modify, and create Word, Excel, and PowerPoint files, with no Office or runtime to install
- Rendering engine: view html, view screenshot, and a live watch preview covering shapes, charts, equations (OMML to LaTeX via KaTeX), 3D .glb models, morph transitions, and shape effects
- Formula engine: 350+ Excel functions evaluated on write, including dynamic arrays, lookup, financial and bond math, and statistical distributions and regression
- Pivot tables: native OOXML pivots from a source range with multi-field rows and columns, 10 aggregations, showDataAs modes, date grouping, calculated fields, top-N, and layout control
- Word depth: internationalisation and right-to-left support, tables, styles, headers and footers, equations, mermaid diagrams, comments, footnotes, watermarks, tables of contents, fields, form fields, content controls, and tracked changes
- PowerPoint depth: slides, shapes, images, tables, charts, animations and transitions, 3D models, slide zoom, themes, connectors, video and audio, groups, notes, comments, and placeholders
- Template merge: merge fills a designed template from JSON data so production runs stay deterministic and identical in layout
- Round-trip dump: dump serialises a document or subtree to batch JSON that batch replays into a new file
- Resident and batch modes: in-memory sessions over named pipes, atomic batches, and flags to keep partial results or stop at the first failing command
- MCP server: officecli mcp registers a built-in Model Context Protocol server that exposes the document operations as tools over JSON-RPC
- Agent skill install: officecli install detects coding agents on the machine and writes its skill file for them
Integrates with
AionUi
Free, local, open-source 24/7 Cowork app for OpenClaw, Hermes Agent, Claude Code, Codex, OpenCode, Gemini CLI and 20+ more CLI.
Claude Code
Terminal-based agentic coding tool that reads your codebase and runs tasks through natural-language commands
Codex
Lightweight coding agent that runs in your terminal
Model Context Protocol
Open protocol plus SDKs for connecting agents to tools and data sources.