idx watch for filesystem
Stream filesystem change events from the live idx index.
Signature
> idx watch {flags} (pattern)
Flags
--ignore, -i {list<string>}: List of globs or path-prefixes to exclude.--timeout, -t {duration}: Stop streaming after this duration.--max-events, -n {int}: Stop after emitting this many events.
Parameters
pattern: Base-relative glob, path, or directory to watch. Omit or pass empty to watch the whole indexed tree.
Input/output types:
| input | output |
|---|---|
| nothing | table<kind: string, path: string> |
Examples
Watch the whole indexed tree after initializing idx.
> idx init .; idx watchWatch only Rust files, ignoring a vendor-style path prefix.
> idx watch "**/*.rs" --ignore [target]Take action on modified files in a pipeline.
> idx watch | where kind == "modified" | each { |e| print $"changed: ($e.path)" }Stop after a single event (useful in scripts).
> idx watch --max-events 1Stop after a duration if no more events are needed.
> idx watch --timeout 5secNotes
Requires a live runtime initialized without --no-watch. Events are debounced by fff-search and emitted as records with kind (created, modified, removed, rescan) and absolute path. Gitignored and other index-ignored files do not produce events. Patterns must be inside the indexed base path. Use plain watch for ad-hoc path watching without an index.