CLI tool and libfswatch front end that watches paths using native OS APIs such as FSEvents, inotify, kqueue, or Windows directory notifications.
Overview
fswatch prints notifications when watched files or directories change. It wraps libfswatch and selects among platform-specific monitors or a portable polling backend.
On macOS it defaults to FSEvents; on Linux to inotify; on BSD to kqueue; on Solaris derivatives to file event notification; and on Windows to ReadDirectoryChangesW. A stat-based poll monitor works wherever stat is available.
Features include recursive directory monitoring, include and exclude regular expression filters, customizable output formats, and periodic idle events. Output can be piped to shell loops with null-delimited records.
Documentation ships as Texinfo, HTML, PDF, and a man page stub, with releases installable through Homebrew, MacPorts, FreeBSD pkg, or source tarballs.
Key features
- Multiple OS-specific backends
- Recursive directory watches
- Regex include and exclude filters
- Configurable record formatting
- Manual monitor selection flag
- Null-delimited output mode
- libfswatch C, C++, and Go bindings
- Package manager installations
Use cases
- Reloading dev servers on save
- Triggering test reruns from scripts
- Watching config directories
- Cross-platform build automation hooks