watchexec watchexec
winget install --id=watchexec.watchexec -e Executes commands in response to file modifications
winget install --id=watchexec.watchexec -e 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 build
Call/restart python server.py when any Python file in the current directory (and all subdirectories) changes:
$ watchexec -r -e py -- python server.py
More usage examples: in the CLI README!
cargo binstall watchexec-clicargo 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: