Repository navigation
Architecture
cmd_op is a self-contained .NET binary. It reads and writes OOXML packages directly; Office, Python, and COM are not involved.
| Layer | Purpose | Commands |
|---|---|---|
| L1 Read | Semantic views |
view (text, outline, annotated, stats, issues, html, svg, screenshot, pdf) |
| L2 DOM | Element operations |
get, query, set, add, remove, move, swap
|
| L3 Raw XML | XPath fallback |
raw, raw-set, add-part, validate
|
Every element has a stable path such as /slide[1]/shape[2]; indexes are 1-based and use element names, not XPath.
The renderer turns a document into HTML, and PNG screenshots are produced through a headless browser. That lets an agent check overflow, overlap, and layout before delivery — in CI, Docker, or a headless server.
Every command supports --json with stable envelopes. Mutations return {success, path}; errors carry code, message, and suggestion. Exit code 2 means the command ran with caveats.
open keeps a document in memory and serves edits over a named pipe; the SDKs use this to avoid process startup per call. Run save or close before another tool reads the file.
- macOS is not covered.
- Complex layout fidelity is best-effort, not pixel-identical to Office.
-
serveis loopback-only by default.
Canonical details: docs/.
Apache-2.0 · © 2026 karlmoriaty · Repository · Docs