iOfficeAI/OfficeCLI
A single-binary OOXML CLI for agents to edit, render, and validate Office files
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
OfficeCLI is a C# application shipped as a self-contained .NET binary. Its interface has three levels: semantic inspection via view; structured operations via commands such as get, query, set, and add; and a raw OOXML fallback via raw, raw-set, and add-part. The DOM uses one-based paths such as /slide[1]/shape[2], not XPath. XPath is reserved for raw XML access.
A caller can drive the CLI through --json, use batch mode to apply multiple operations in one pass, or keep a document open in a resident session and flush it with close. validate and view issues give callers a way to check output after edits; structured error codes such as invalid_value support targeted retries. The CLI contract is concrete, but an MCP server entrypoint, transport, and tool schema are not established.
Key Capabilities & Differentiators
OfficeCLI creates, reads, and edits .docx, .xlsx, and .pptx. Its renderer outputs standalone HTML with inline assets, uses a headless browser for per-page PNGs, and serves an auto-refreshing local preview through watch. That gives an agent a way to inspect layout after a structural edit; JSON alone cannot show text overflow or overlapping shapes.
On the spreadsheet side, the engine evaluates 350+ built-in functions on write, including spilling dynamic arrays and financial and statistical functions. Native pivot tables write both the cache and definition to OOXML. For repeatable output, merge fills {{key}} placeholders from JSON across all three formats, while dump serializes a whole document or a subtree into batch JSON that can be replayed with batch.
Trade-offs & Limitations
Compared with python-docx and openpyxl, OfficeCLI gives an agent one subprocess interface across three formats without maintaining separate library adapters. In a Python application, however, direct library calls avoid shell argument handling and expose in-process objects. Batch and resident modes help when edits are related, but the caller still has to manage session lifetime and ensure the final file is on disk before another process consumes it.
LibreOffice and Microsoft Office are better fits when interactive editing is the main job. OfficeCLI's own renderer and evaluator are useful for feedback, not a guarantee of identical layout or calculation in the destination application. Validate package structure, then test representative layouts and formulas in the application that will open the files. Raw XML access fills gaps in DOM coverage but puts responsibility for OOXML relationships and element ordering on the caller.
Hardware & Deployment Guide
Run the native binary on macOS, Linux, or Windows; release artifacts are listed for both x64 and ARM64 on all three. The binary embeds .NET, so no separate runtime or Microsoft Office installation is required. A platform-matched binary can run locally or in a headless CI or Docker environment. Smoke-test browser-backed screenshot capture separately on your worker image. watch serves a local preview at http://localhost:26315.
For reproducible deployments, pin the release artifact and disable background update checks with officecli config autoUpdate false or set OFFICECLI_SKIP_UPDATE=1 per invocation. Recent fixes illustrate why representative-file testing matters: v1.0.162 improved validation for missing package parts referenced by content-type overrides, and v1.0.161 fixed XLSX formatting-element ordering and duplicate IDs on materialized PowerPoint placeholders.
--json output and one-based element paths such as /slide[1]/shape[2].raw and raw-set, with package checks via validate.watch.merge fills JSON-backed {{key}} fields; dump and batch capture and replay whole documents or subtrees.close flushes the session to disk.Agent or CI workflows that generate recurring reports, edit templates, or turn Office documents into structured data, with previews and validation before delivery.
You need a desktop editor, a native in-process Python API, or exact Microsoft Office rendering and calculation without testing in the destination application.
Quick Start & Installation
curl -fsSL https://officecli.ai/SKILL.md
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| OfficeCLI ★ | 33.8k | +135 | C# | Apache-2.0 | A single-binary OOXML CLI for agents to edit, render, and validate Office files |
| hermes-agent | 268.1k | +1.5k | Python | MIT | Self-hosted Python agent with persistent memory and automation across chat and C |
| n8n | 213.1k | +787 | TypeScript | — | Visual Node.js platform for self-hosted workflows and multi-step AI agents |
| OpenHands | 94.8k | +374 | TypeScript | MIT | Self-hosted control plane for coding agents across local, remote, and cloud back |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/iOfficeAI/OfficeCLI.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about OfficeCLI
How should an agent integrate OfficeCLI into an editing workflow?
--json. Inspect the document with view, locate elements with get or query, then edit through the DOM and run validate. Batch mode groups related operations; when using a resident session, call close before handing the file to a downstream process so changes are flushed to disk. The MCP tag does not establish a server entrypoint, transport, or tool schema.What runtime and hardware should a headless worker have?
Can a company self-host or redistribute OfficeCLI?
NOTICE and THIRD-PARTY-NOTICES.txt for your distribution. For controlled environments, pin the binary version and disable background updates as part of the deployment policy.When is OfficeCLI a better fit than LibreOffice or Python libraries?
python-docx or openpyxl when in-process objects and direct integration with an existing Python application matter more. Consider LibreOffice for desktop editing or conversion, and inspect critical deliverables in Microsoft Office when its display or calculation behavior is the acceptance criterion.Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy