Skip to content

command watch

zmworm edited this page Mar 27, 2026 · 42 revisions

watch / unwatch

Live HTML preview server that auto-refreshes when the document changes.

watch

officecli watch <file> [--port N]

Starts an HTTP server that serves a live HTML preview of a PowerPoint document. The preview automatically refreshes whenever the document is modified via any OfficeCLI command (set, add, remove, move, raw-set).

Arguments

Name Type Required Default Description
file FileInfo Yes - PowerPoint document path (.pptx)

Options

Name Type Required Default Description
--port int No 18080 HTTP port for the preview server

Behavior

  • 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, or raw-set command on the same file triggers an incremental refresh.
  • Press Ctrl+C to stop the server, or use unwatch from 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.

Examples

# Start live preview on default port
officecli watch slides.pptx

# 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"

unwatch

officecli unwatch <file>

Stops the watch preview server for the specified document from another terminal.

Examples

officecli unwatch slides.pptx

Notes

  • Only available for .pptx files.
  • Equations are rendered using KaTeX.
  • The preview includes slide navigation UI, connector arrowheads, custom geometry, 3D effects, gradients, 3D models (rendered via Three.js), and zoom objects.

See Also


Based on OfficeCLI v1.0.24

Clone this wiki locally