OfficeCLI is a command-line Office suite for AI agents and automation scripts that reads, edits and creates .docx, .xlsx and .pptx files without Office installed, rendering results to HTML or PNG.
- v1.0.161
- Published at
- 1d ago
- 33,234
- Stars
- 52,305
- Download
- Synced at
- 23h ago
Latest release
v1.0.161Nov 12, 2026, 09:51 AMREADME
Project Overview
OfficeCLI turns a single terminal command into a deliverable Word, Excel or PowerPoint file, with no Office installation and no Python document libraries. It ships as one self-contained .NET executable that bundles the document engine, a renderer and a formula/pivot engine, and elements are addressed by stable paths rather than XML namespaces. The current release is v1.0.160 under Apache-2.0, with binaries published separately for six platform and architecture combinations.
| Item | Value |
|---|---|
| Platform | Windows, macOS, Linux on x64 and ARM64 |
| Runtime | Self-contained .NET, no separate install |
| Formats | .docx, .xlsx, .pptx |
| License | Apache-2.0 |
| Latest release | 1.0.160 |
Agents can write a document, render it, and revise it again, all inside one binary.
Core Commands
| Command | Action |
|---|---|
create |
Create a blank docx, xlsx or pptx |
add |
Append an element by path, such as / --type slide |
set / remove |
Modify or delete the element at a path |
view |
Print text, outline, html, screenshot or other views |
get / query |
Read element JSON or find elements by selector |
merge |
Fill {{key}} placeholders with JSON data |
batch |
Run several commands in one pass, optionally with --force |
watch |
Serve a live preview at http://localhost:26315 |
mcp |
Register the MCP server for Claude, Cursor, VS Code or LM Studio |
Key Features
- Three formats: docx, xlsx and pptx can all be read, modified and created
- Path addressing: paths such as
/slide[1]/shape[2]use 1-based indexes and local element names, so XML namespaces stay out of the way - Three layers: L1
viewfor semantic views, L2 DOM commands for element edits, L3rawandraw-setfor direct XML - Built-in rendering:
view htmlwrites a self-contained HTML file,view screenshotexports PNG pages, andwatchrefreshes automatically - Formula evaluation: 150+ Excel functions evaluate on write, with dynamic array functions getting the
_xlfn.prefix automatically - Native pivot tables:
add ... --type pivottablewrites the pivot cache and definition straight into OOXML - Template merge:
mergereplaces placeholders in paragraphs, table cells, shapes, headers, footers and chart titles - Structured output: every command supports
--json, and codes such asnot_foundandinvalid_valuereturn suggestions and valid ranges - Resident and batch modes:
openkeeps a document in memory, andbatch --forcecontinues after errors
Target Audience
- Engineers building AI agents and tool calls
- Developers writing document automation scripts
- Teams maintaining CI/CD documentation pipelines
- Server and container users who cannot install Office
- Data teams that generate reports in bulk
Quick Start
- Run
install.sh(orinstall.ps1on Windows), or download a binary and runofficecli installto put it on PATH - Create a deck:
officecli create deck.pptx - Start the preview:
officecli watch deck.pptxand openhttp://localhost:26315 - In another terminal add a slide:
officecli add deck.pptx / --type slide --prop title='Q4 Report' - Print the outline:
officecli view deck.pptx outline - Read element JSON:
officecli get deck.pptx '/slide[1]/shape[1]' --json
System Requirements
| Item | Requirement |
|---|---|
| OS | macOS (Apple Silicon, Intel), Linux x64/ARM64, Windows x64/ARM64 |
| Runtime | .NET is bundled; Office and Python are not required |
| Screenshots | view screenshot needs a local headless browser |
| Installation | install.sh, install.ps1, or a single-file binary from Releases |
Notes
- Config file: stored at
~/.officecli/config.json;officecli config autoUpdate falsedisables automatic updates - Release filenames:
officecli-mac-arm64,officecli-mac-x64,officecli-linux-x64,officecli-linux-arm64,officecli-win-x64.exeandofficecli-win-arm64.exe - Not XPath: paths use 1-based indexes and local element names; use
rawandraw-setwhen XPath is required - Screenshots need a browser:
view screenshotcaptures the rendered HTML through a headless browser, so a bare container must provide one - Skip one update check: updates are checked in the background by default; set
OFFICECLI_SKIP_UPDATE=1to skip a single check