Option to expose initial watch state on first invocation
Author: dzuelkeCreated Jan 15, 2026Updated Feb 26, 2026
Labelsnew feature
I'd love an option that would enable the submission of the current state of the watched paths on first invocation.
For example, watchexec --emit-events-to=json-stdio --initial-events=create -- cat would submit the current contents of the current directory as a JSON payload to cat on first call, with every file having an artificial create event (or there could be a new existing event type).
This would be useful for e.g. conversion watchdog jobs that wrap watchexec and then call themselves; this way, they could kick off an initial run of whatever filters given to watchexec apply to the current contents of a directory.
Source: watchexec/watchexec