iOfficeAI

OfficeCLI

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 AM
Downloads slow? Switch the source anytime above

README

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 view for semantic views, L2 DOM commands for element edits, L3 raw and raw-set for direct XML
  • Built-in rendering: view html writes a self-contained HTML file, view screenshot exports PNG pages, and watch refreshes automatically
  • Formula evaluation: 150+ Excel functions evaluate on write, with dynamic array functions getting the _xlfn. prefix automatically
  • Native pivot tables: add ... --type pivottable writes the pivot cache and definition straight into OOXML
  • Template merge: merge replaces placeholders in paragraphs, table cells, shapes, headers, footers and chart titles
  • Structured output: every command supports --json, and codes such as not_found and invalid_value return suggestions and valid ranges
  • Resident and batch modes: open keeps a document in memory, and batch --force continues 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

  1. Run install.sh (or install.ps1 on Windows), or download a binary and run officecli install to put it on PATH
  2. Create a deck: officecli create deck.pptx
  3. Start the preview: officecli watch deck.pptx and open http://localhost:26315
  4. In another terminal add a slide: officecli add deck.pptx / --type slide --prop title='Q4 Report'
  5. Print the outline: officecli view deck.pptx outline
  6. 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 false disables automatic updates
  • Release filenames: officecli-mac-arm64, officecli-mac-x64, officecli-linux-x64, officecli-linux-arm64, officecli-win-x64.exe and officecli-win-arm64.exe
  • Not XPath: paths use 1-based indexes and local element names; use raw and raw-set when XPath is required
  • Screenshots need a browser: view screenshot captures 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=1 to skip a single check

Release history

Sort