Executes commands in response to file modifications
Executes commands in response to file modifications
Software development often involves running the same commands over and over. Boring!
watchexec is a simple, standalone tool that watches a path and runs a command whenever it detects modifications.
Example use cases:
xargs.gitignore and .ignore filesWatch all JavaScript, CSS and HTML files in the current directory and all subdirectories for changes, running npm run build when a change is detected:
$ watchexec -e js,css,html npm run buildCall/restart python server.py when any Python file in the current directory (and all subdirectories) changes:
$ watchexec -r -e py -- python server.pyMore usage examples: in the CLI README!
cargo binstall watchexec-cli cargo install --locked watchexec-cliAll options in detail: in the CLI README,
in the online help (watchexec -h, watchexec --help, or watchexec --manual),
and in the manual page.
Watchexec pairs well with:
makeSelected downstreams of watchexec and associated crates:
Feature request: add option to run at least every time period
FreeBSD inotify backend
fanotify backend
Command hangs if it tries to set terminal modes
Command killed by Custom(4)
Option to expose initial watch state on first invocation
Limit execution time or count
The `--ignore` parameter does not take effect
Optionally page output
Feature wanted: PTY support for interactive REPLs