Description
Watchexec is a simple, standalone command-line tool that watches a path and runs a command whenever files in it change. Software development often means running the same commands again and again, such as unit tests, linters and build steps, and Watchexec runs them for you on each change. It monitors the current directory and all its subdirectories by default. It merges several filesystem events into one, so editors that write swap and backup files do not trigger repeated runs, and it loads .gitignore and .ignore files so ignored paths are skipped. It uses process groups to keep hold of programs that fork, and it can pass the paths that changed to your command through environment variables or standard input. Watchexec runs on macOS, Linux and Windows and needs no language runtime, so it works with any ecosystem. You can filter by file extension, for example to rebuild on changes to JavaScript, CSS and HTML files, or to restart a Python server when a Python file changes. The README lists install options through package managers for Arch, Debian, Homebrew, Nix, Scoop and Chocolatey, through cargo-binstall, and as a binary or from source.…
Highlights
- Runs commands when files change
- Watches subdirectories by default
- Respects .gitignore and .ignore files
- Runs on macOS, Linux and Windows
- Works with any language or ecosystem
Ratings & Reviews
No ratings yet
Be the first to rate Watchexec.
People also visit
Watchexec FAQ
What does Watchexec do?
It watches files or folders and runs a command each time they change, such as rerunning tests or rebuilding a project.
How do I install it?
Use a package manager such as Homebrew, Scoop or Nix, download a binary from the GitHub releases, or run cargo binstall watchexec-cli.
Does it work on Windows?
Yes. The README says it runs on macOS, Linux and Windows.
Can I limit it to certain file types?
Yes. Pass extensions with -e, for example watching only JavaScript, CSS and HTML files for a build.
Will it ignore my git-ignored files?
Yes. It loads .gitignore and .ignore files, so paths listed there are skipped.
Is it free?
The source is public on GitHub, and the project is open source.
What are the best Watchexec alternatives?
Popular alternatives to Watchexec include Modd, Taskctl and Livediff. See all Watchexec alternatives



