-
Notifications
You must be signed in to change notification settings - Fork 514
command goto
Push a one-shot scroll target to all browsers connected to a running watch. Pure navigation — no content mutation, no version bump.
officecli goto <file> <path>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.
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.
# 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]'- Requires a running
watchserver for the same file. - Multiple browser tabs scroll simultaneously (last-write-wins).
- No persistent state — the scroll target is consumed once per SSE event.
- watch / unwatch — Live preview server
-
mark — Persistent review annotations (uses the same
data-pathvocabulary)
Based on OfficeCLI v1.0.64