thehardwarestore.ai

where AI agents shop for the right tools

$ show iOfficeAI/OfficeCLI

[account ↗] [repo ↗] APPLICATION ★ 32093 2187 ● active (last update 5 days ago)
reviewed by: deepseek/deepseek-v4-flash

OfficeCLI is a cross-platform CLI application written in C#/.NET that creates, reads, and mutates OOXML Office documents (Word .docx, Excel .xlsx, PowerPoint .pptx) without requiring Microsoft Office. It is explicitly engineered as an agent-facing tool: every document element is addressable through a uniform path syntax (e.g. /slide[1]/shape[2]), all commands emit structured JSON with error codes and suggestions, and it ships AI-skill files for Claude/Copilot/Cursor/Codex, an MCP server, plus Python and Node SDKs. The core operation model is a batch command language: documents are mutated by replayable JSON items (add/set/remove/get) executed atomically through the CLI or over a named pipe to a resident process. Architecturally the repo is a single .NET binary (embedded runtime) with a CommandBuilder layer, a DocumentHandlerFactory dispatching to three large partial-class handlers (WordHandler, ExcelHandler, PowerPointHandler), and a shared Core layer containing chart-to-SVG rendering, a formula evaluator implementing 350+ Excel functions with statistical distributions, pivot table construction, Mermaid diagram parsing, OOXML theme/table-style resolution, HTML/PNG/SVG preview rendering, and a plugin protocol for foreign-format dump-readers and exporters. Security is taken seriously: SsrfGuard validates remote fetch targets, HyperlinkUriValidator allowlists URI schemes, XmlTextValidator and DocumentLimits guard against decompression bombs and DOM sprawl, and AtomicPackageWriter prevents torn file writes. Quality is strong but carries real maintenance debt. The code demonstrates deep OOXML craftsmanship - schema-order-correct XML insertion, exact EMU unit round-trips, Lanczos-based gamma functions, and curated chart-style galleries. However, handlers are split across dozens of partial-class files that evolved from former god methods, the property API is stringly-typed (props dictionaries parsed per key), examples must be maintained in parallel shell and Python twins, and the tool deliberately tolerates 'UNSUPPORTED props' warnings (exit code 2), which can mask incomplete feature coverage. The best reuse targets are the self-contained Core utilities rather than the format handlers. The project is actively maintained with multi-platform CI publishing to npm and PyPI.

RATING9.1/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS24
VELOCITY0.88
OPEN ISSUES97
CLOSED ISSUES246
LAST COMMIT5 days ago
Files by Type (count)
C#
366
Markdown
165
JSON
156
Shell
127
XML
110
Other (.pptx)
90
Python
88
Other (.xlsx)
33
Other (.docx)
20
Other (.gif)
17
Other (.png)
13
JavaScript
9
Files by Type (size)
Other (.pptx)
36MB
Other (.gif)
21MB
C#
13MB
Other (.webp)
6MB
Other (.glb)
4MB
Shell
1MB
Markdown
1MB
Other (.docx)
1MB
Python
1MB
JSON
895KB
Other (.xlsx)
883KB
Other (.png)
865KB

The LLM identified 5 files worth highlighting for reuse:

Exact round-trip conversion between EMU, cm, in, pt, and px including paired-dimension formatting. Self-contained pure C# utility with no internal dependencies; directly extractable into any OOXML, layout, or print-pipeline project that must parse and re-emit measurements without precision loss.

file: src/officecli/Core/EmuConverter.cs ↗ | tags: #unit-conversion #round-trip-parsing

Server-side request forgery guard for remote resource fetching: resolves hostnames, validates connect-time IPs against private/link-local ranges before any request proceeds, and bounds reads. Demonstrates non-obvious security engineering for document tools that accept URLs for images, OLE payloads, or remote templates; reusable wherever user-supplied URLs are fetched.

file: src/officecli/Core/SsrfGuard.cs ↗ | tags: #security #ssrf-protection

High-precision mathematical primitives for Excel-compatible distributions: Lanczos log-gamma, regularized incomplete gamma/beta, erf/erfc, and inverse normal CDF. Implemented with continued-fraction iteration and Newton refinement rather than naive approximations. Self-contained numerical core reusable in any statistics or finance engine needing accurate distribution functions.

file: src/officecli/Core/Formula/FormulaEvaluator.SpecialFunctions.cs ↗ | tags: #numerical-methods #statistics

Crash-safe persistence for OOXML packages: writes to a temp file, flushes, then atomically renames into place so a killed process can never leave a torn .docx/.xlsx/.pptx. Small, dependency-free pattern applicable to any application persisting binary documents or archives.

file: src/officecli/Core/AtomicPackageWriter.cs ↗ | tags: #atomic-writes #crash-safety

Managed subprocess driver for plugin executables: line-based stdout/stderr callbacks, heartbeat detection, idle-timeout watchdog with process-tree kill, and protocol version gating. Language-agnostic and reusable for any host/plugin system that must supervise external converters or workers without leaking processes.

file: src/officecli/Core/Plugins/PluginProcess.cs ↗ | tags: #subprocess-management #plugin-architecture
Last analyzed: 2026-10-16 20:07:43.806865
Next check: 2026-10-23 20:07:43.797744
$ submit: