AB
AiBoss
project

OfficeCLI - An open-source command-line Office suite designed specifically for AI agents.

OfficeCLI is the world's first open-source command-line Office suite designed specifically for AI agents, launched by the iOfficeAI team. It allows any AI agent to fully control Word, Excel, and PowerPoint with just one line of code...

What is Office CLI?

OfficeCLI, launched by the iOfficeAI team, is the world's first open-source command-line Office suite designed specifically for AI agents. It allows any AI agent to fully control the reading, creation, editing, and automated processing of Word, Excel, and PowerPoint files with just one line of code. The project uses a single self-contained binary file with an embedded .NET runtime, requiring no Microsoft Office installation or any dependencies, and runs across macOS, Linux, and Windows platforms. It includes a built-in MCP server and SKILL.md skill file, automatically configuring upon installation to mainstream AI programming assistants such as Claude Code, Cursor, and VS Code Copilot, achieving zero-configuration, out-of-the-box usability.

Main functions of Office CLI

  • Full-format document operationsIt fully supports the creation, reading, modification, and batch processing of Word (.docx), Excel (.xlsx), and PowerPoint (.pptx) files.
  • Three-layer progressive architecture:
    • L1 Reading LayerSemantic view, supporting text, outline, statistics, problem diagnosis, and HTML preview.
    • L2 DOM layerStructured element operations (get / query / set / add / remove / move / swap)
    • L3 Raw XML LayerDirect access via XPath, serving as a universal fallback solution.
  • Real-time preview mode:officecli watch Start a local HTTP server, and the browser will render the document changes in real time. It supports clicking on selected elements and syncing them back to the CLI.
  • Built-in MCP serverIt exposes all document manipulation capabilities via JSON-RPC, and allows one-click registration with Claude Code, Cursor, VS Code Copilot, LM Studio, etc., without requiring shell access.
  • AI Automatic IntegrationAfter installing the binary file, it automatically detects the known AI tool configuration directory and installs the SKILL.md skill file. Once the agent reads the file, it can learn all commands autonomously.
  • Resident memory mode:officecli open Keep documents in memory for near-zero latency continuous batch editing.
  • Template merging:support {{key}} Placeholder replacement allows for batch generation of documents based on JSON data.
  • Full command-line help system:officecli help <格式> <元素> Provides complete attributes, aliases, examples, and a machine-readable structured schema.

How to use OfficeCLI

  • Install binary filesExecution on macOS / Linux curl -fsSL https://raw.githubusercontent.com/iOfficeAI/OfficeCLI/main/install.sh | bashWindows PowerShell execution irm https://raw.githubusercontent.com/iOfficeAI/OfficeCLI/main/install.ps1 | iexAlternatively, you can manually download the single executable file for the corresponding platform (macOS/Windows/Linux, x64/ARM64) from GitHub Releases.
  • Verify installationTerminal execution officecli --versionOnce the version number is confirmed, the installation is considered successful.
  • Create a blank document:implement officecli create deck.pptx,officecli create report.docx or officecli create budget.xlsx Quickly generate Office files in the corresponding format.
  • Add and edit content:use officecli add <文件> <路径> --type <元素> --prop <属性> Add slides, paragraphs, shapes, tables, etc.; use officecli set <文件> <路径> --prop <属性> Modify the style, text, position, etc. of existing elements.
  • View document structure:implement officecli view <文件> text Extract plain text,officecli view <文件> outline View the outline hierarchy.officecli view <文件> stats View element statistics,officecli view <文件> html Generates a browser-renderable HTML preview.
  • Start live preview:implement officecli watch <文件> --port 26315 Start a local HTTP server, and the browser renders the document in real time. The page is automatically refreshed after each add/set/remove operation. It also supports clicking on selected elements and syncing back to the CLI.
  • AI Automatic Integration:implement officecli install Automatically scan and configure AI assistants such as Claude Code, Cursor, VS Code Copilot, and LM Studio; or execute manually. officecli mcp claude / officecli mcp cursor / officecli mcp vscode Register the MCP server.
  • Manual feeding skill fileIf the automatic configuration does not cover the current environment, you can execute... curl -fsSL https://officecli.ai/SKILL.md -o ~/.claude/skills/officecli.md(Taking Claude Code as an example), the AI can read it and learn all the command syntax and structure on its own.
  • Programming language callIn languages such as Python, JavaScript/Node.js, and Go, through subprocess / child_process Call OfficeCLI commands, append --json The parameters are obtained in a structured output format, which facilitates program parsing and processing.
  • Memory-resident batch processing:implement officecli open <文件> The document is kept in memory, and subsequent batch editing is achieved by executing multiple add/set/remove commands in succession, with automatic saving upon completion.
  • Batch template generation: Prepare to include {{key}} The template file for placeholders, combined with JSON data, uses OfficeCLI commands to batch replace and generate standardized documents such as contracts, reports, and tenders.
  • Management Configuration and Updates:implement officecli config View or modify ~/.officecli/config.json;implement officecli config autoUpdate false Or set environment variables OFFICECLI_SKIP_UPDATE=1 Turn off automatic updates.

OfficeCLI official website address

  • Github repositoryhttps://github.com/iOfficeAI/OfficeCLI

Key information and usage requirements for Office CLI

  • Open source licenseApache 2.0.
  • Operating environment: macOS, Linux, Windows (x64/ARM64).
  • Dependency requirementsZero dependencies; no Office or runtime installation required.
  • Installation permissionsRequires write permissions to the system PATH (the automatic installation script will attempt to write to it). /usr/local/bin (or equivalent path).
  • Configuration file path:~/.officecli/config.json,support officecli config manage.
  • Automatic updatesBy default, the background automatically checks for updates, which can be done through... officecli config autoUpdate false or environment variables OFFICECLI_SKIP_UPDATE=1 closure.
  • AI Skills FilesSKILL.md is approximately 239 lines / 8K tokens, covering command syntax, architecture design, and common pitfalls.
  • MCP RegistrationSupports Claude Code, Cursor, VS Code/Copilot, and LM Studio. officecli mcp list Check registration status.

OfficeCLI's core advantages

  • AI Native DesignDesigned specifically for AI Agents, it enables agents to manipulate documents without needing to understand XML namespaces, based on path addressing.
  • Zero dependencies, ready to use out of the boxA single binary file with an embedded .NET runtime, requiring no Office, WPS, or Python environment to be installed.
  • Cross-platform full coverage: Supports macOS Apple Silicon/Intel, Linux x64/ARM64, Windows x64/ARM64.
  • Dual-mode AI integrationIt supports both SKILL.md (natural language instruction set, approximately 8K tokens) and MCP server (JSON-RPC secure call), adapting to both restricted and rich environments.
  • Real-time feedback closed loopReal-time browser preview + instant CLI command activation greatly improves development and debugging efficiency.
  • Production-level capabilitiesSupports 150+ built-in Excel functions, pivot tables, conditional formatting, PPT Morph transitions, 3D models (.glb), OLE objects, and other advanced features.
  • Open source and freeLicensed under the Apache 2.0 license, it can be freely used in commercial settings.

Comparison of OfficeCLI with similar competing products

Comparison Dimensions Office CLI Unoserver Python-Office library combination (python-docx / openpyxl / python-pptx)
Product Positioning The world's first command-line Office suite designed specifically for AI agents. Command-line document conversion and monitoring service based on LibreOffice Traditional Python libraries for reading and writing Office documents.
Core Competencies Creating, reading, fine-grained editing, real-time previewing, template filling, and batch automation of Word/Excel/PPT documents. Document format conversion (e.g., DOCX ↔ PDF, XLSX ↔ CSV), document comparison Programmatic read and write operations on Word, Excel, and PowerPoint require writing Python scripts.
AI native support It includes a built-in MCP server and SKILL.md file, and automatically integrates Claude Code, Cursor, Copilot, etc. after installation. There is no native AI integration; it needs to be implemented through shell calls or encapsulated in a programming language. Without native AI integration, the AI agent needs to indirectly call it by generating Python code.
How to use A single binary command line, executed directly. officecli add/set/view Wait for the command It needs to be started first. unoserver Listening service, and then through unoconvert Perform conversion You need to install a Python environment and several dependency libraries, and write scripts to call the API.
Environment dependency Zero dependencies, single self-contained binary, embedded .NET runtime It requires the installation of LibreOffice and Python environments, making it a relatively heavy dependency. Python and pip dependencies must be installed.pip install python-docx openpyxl python-pptx)
Installation complexity Install with a single command (curl/irm), and it's ready to use out of the box. You need to install LibreOffice, Python, and pip to install unoserver and configure the listening service. Multiple Python libraries need to be installed separately, and version compatibility needs to be addressed.
Document editing granularity A three-tier architecture (semantic view / DOM element manipulation / raw XML) supports fine-grained editing of paragraphs, tables, charts, animations, formulas, and more. Only whole document conversion is supported; internal element-level editing is not supported. It supports element-level editing, but the API is complex, and different formats require calling different libraries.
Live Preview built-in officecli watch Start a local HTTP server and let the browser render in real time. No real-time preview capability There is no real-time preview capability; you need to save and open it manually to view.
Resident memory mode support officecli open Memory-resident, near-zero latency continuous operation By using a listener mode, LibreOffice can be reloaded repeatedly, reducing CPU load by 50%-75%. The library itself does not have a resident mode; it needs to be reloaded every time the script is executed.
Cross-platform support macOS / Linux / Windows (x64 / ARM64) All Platforms Primarily designed for Linux/Unix; support for Windows and macOS is not fully tested. Cross-platform, but depends on Python environment configuration.

Application scenarios of Office CLI

  • Automated report generationAutomatically generate Word/Excel/PowerPoint reports from database or API data and embed them into CI/CD pipelines.
  • AI presentation generationBased on the user's natural language prompts, the AI Agent automatically creates PPTs without templates or manual editing.
  • Batch document processingFeatures include batch search and replace, style updates, format standardization, and watermark addition.
  • Structured data extractionExtract the content from Word/Excel/PPT into JSON for downstream systems to consume.
  • Document quality verificationAutomatically checks for document formatting issues, broken links, missing elements, etc. before delivery.
  • Financial Model Building:pass officecli-financial-model Skills include building three-table models, DCF valuation, and formula-driven Excel models such as Cap Table.