Skip to content

command goto

zmworm edited this page Apr 29, 2026 · 3 revisions

goto

Push a one-shot scroll target to all browsers connected to a running watch. Pure navigation — no content mutation, no version bump.

Synopsis

officecli goto <file> <path>

Description

Sends a scroll action over the watch named pipe. Every connected SSE client (browser tab) calls scrollIntoView for the resolved element. Multiple tabs of the same file scroll in sync.

If no watch is running for <file>, the command is a silent no-op. If the path resolves but the resulting CSS selector matches no element in the watching browser's cached HTML, the command exits with status 1.

Supported paths

Currently resolves Word paths via the data-path attribute emitted by the HTML renderer:

Path CSS target
/body/p[N] #w-p-N (legacy anchor)
/body/table[N] #w-table-N (legacy anchor)
/body/table[N]/tr[R] [data-path="/body/table[N]/tr[R]"]
/body/table[N]/tr[R]/tc[C] [data-path="/body/table[N]/tr[R]/tc[C]"]
/slide[N] PPT slide navigation (via data-slide selector)

Cell-level tc[C] paths share the same data-path vocabulary as mark — cell-level navigation and cell-level marks stay aligned.

Examples

# Scroll to a specific Word paragraph
officecli goto report.docx /body/p[42]

# Scroll to a table cell
officecli goto report.docx '/body/table[2]/tr[3]/tc[1]'

# Jump to a PPT slide
officecli goto deck.pptx '/slide[5]'

Notes

  • Requires a running watch server for the same file.
  • Multiple browser tabs scroll simultaneously (last-write-wins).
  • No persistent state — the scroll target is consumed once per SSE event.

See Also

  • watch / unwatch — Live preview server
  • mark — Persistent review annotations (uses the same data-path vocabulary)

Based on OfficeCLI v1.0.64

Clone this wiki locally