watchexec
Watches a folder and reruns a command whenever a file changes, for test loops, linting and rebuilds.
These buttons open the developer's own site, repository or store listing in a new tab. wares.gg does not host downloads.
2 more ways to get watchexec
Package managers
- Chocolatey
choco install watchexec - Homebrew
brew install watchexec
About watchexec
watchexec monitors the current directory and everything below it, and runs whatever command you give it when something changes. `watchexec -e js,css,html npm run build` rebuilds on every save; `watchexec -r -e py -- python server.py` restarts a server instead of piling up copies of it.
The details are where it earns its place. It coalesces the burst of filesystem events editors generate when saving through a swap file, reads `.gitignore` and `.ignore` so build output does not trigger itself, and uses process groups so a program that forks children actually gets stopped. It has no language runtime and is not tied to any ecosystem.
Strengths
- Coalesces the multiple events editors fire when saving, so the command runs once
- Honours .gitignore and .ignore, so build output does not retrigger the build
- Process groups mean forking programs are actually killed on restart
- No language runtime and no ecosystem lock-in; it works for any command
Limitations
- Filesystem watching on network shares and some containers is unreliable, which is an OS limitation
- Watching very large trees costs memory and file handles
- No built-in way to debounce beyond its own coalescing window
- Configuration is command-line flags rather than a config file
Details
- Pricing
- FreeFree and open source, dual licensed Apache 2.0 or MIT.
- License
- Apache-2.0
- Developer
- watchexec
- Platforms
- Windows, macOS, Linux, Command line
- How it runs
- Downloadable app
- Account
- Not required
- Works offline
- Yes
- Best suited for
- Rerunning tests, linters or a build automatically every time you save
- Categories
- CLI tools
- Last verified
- Added
- Provenance
- Selected from the TechWalrus downloads catalog (Dev Tools); facts checked against the developer's own pages, 3 sources on file.