-
Notifications
You must be signed in to change notification settings - Fork 102
command watch
zmworm edited this page Mar 31, 2026
·
14 revisions
Live HTML preview server that auto-refreshes when the document changes.
officecli watch <file> [--port N]
Starts an HTTP server that serves a live HTML preview of an Office document. The preview automatically refreshes whenever the document is modified via any OfficeCLI command (set, add, remove, move, raw-set). Supports .pptx, .docx, and .xlsx files.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
file |
FileInfo | Yes | - | Office document path (.pptx, .docx, .xlsx) |
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
--port |
int | No | 18080 |
HTTP port for the preview server |
- Opens
http://localhost:{port}in the default browser automatically. - Monitors the document file and re-renders HTML on every modification.
- Any
set,add,remove,move, orraw-setcommand on the same file triggers an incremental refresh. - Auto-scroll: The preview automatically scrolls to the changed element after each update.
- Press
Ctrl+Cto stop the server, or useunwatchfrom another terminal. - Works with both direct mode and resident mode.
- Idle timeout: Automatically shuts down after 5 minutes of inactivity (no connected clients and no file changes). This prevents orphaned watch servers from running indefinitely.
# Start live preview on default port
officecli watch slides.pptx
# Word document preview
officecli watch report.docx
# Excel spreadsheet preview
officecli watch data.xlsx
# Start on a custom port
officecli watch slides.pptx --port 3000
# In another terminal, make changes — preview auto-refreshes
officecli set slides.pptx /slide[1]/shape[1] --prop text="Updated!"
officecli add slides.pptx /slide[1] --type shape --prop text="New shape"officecli unwatch <file>
Stops the watch preview server for the specified document from another terminal.
officecli unwatch slides.pptx- Available for
.pptx,.docx, and.xlsxfiles. - PowerPoint: Slide navigation UI, connector arrowheads, custom geometry, 3D effects, gradients, 3D models (Three.js), zoom objects. Equations via KaTeX.
- Word: Full formatting with style inheritance, tables (floating, conditional formatting, theme borders), images (anchored, crop), drop caps, multi-column sections, footnotes/endnotes (numbering format), TOC, charts (SVG), equations (KaTeX), run borders/shading, CJK support, headers/footers, page layout from OOXML.
- Excel: Cell formatting, merged cells, frozen panes, hidden rows/cols, embedded charts (SVG), sheet tabs, RTL/i18n support, formula evaluation.
- view html - One-time HTML preview
- open / close - Resident mode for fast workflows
- Command Reference
Based on OfficeCLI v1.0.28