Watch Mode
Watch Mode
Section titled “Watch Mode”Watch mode monitors a runbook.mdx file (and its scripts, checks, or template files) for changes and automatically reloads the runbook in the app.
This feature is intended for authors of runbooks.
Activating watch mode
Section titled “Activating watch mode”Watch mode can be activated in two ways:
-
Via the command line when launching the app:
Terminal window runbooks --watch RUNBOOK_SOURCE -
Via the app menu — toggle watch mode from the application menu while a runbook is open.
Arguments
Section titled “Arguments”RUNBOOK_SOURCE- A local path or remote URL pointing to arunbook.mdxfile or the directory containing arunbook.mdxfile. See Opening a runbook for supported remote URL formats.
What it does
Section titled “What it does”When watch mode is active:
- Watches for changes - Monitors the runbook file and related files for any modifications
- Auto-reloads - Automatically refreshes the runbook in the app when changes are detected (within ~300ms)
Writing a new runbook
Section titled “Writing a new runbook”runbooks open --watch /path/to/runbookThen in your editor:
- Make changes to
runbook.mdx - Save the file
- See your changes instantly in the app — no manual refresh needed
Technical details
Section titled “Technical details”File watching
Section titled “File watching”- Uses
chokidarfor efficient file system monitoring - Watches the directory containing your runbook file
- Implements debouncing (300ms) to handle editors that save files multiple times
- Only triggers on write and create events for your specific runbook file
Auto-reload mechanism
Section titled “Auto-reload mechanism”- Uses IPC (inter-process communication) events to notify the renderer process of file changes
- When the file changes, the main process sends a
file-changeevent via IPC - The renderer receives the event and automatically reloads the runbook content