Watchexec
A standalone command-line tool that watches a path and runs a command whenever it detects file modifications.
Tested on Linux
Use it
Linux x86_64
Download v2.8.0 x86_64 musl prebuilt release tarball from GitHub and copy watchexec into ~/.local/bin
mkdir -p ~/.local/bin /tmp/wx && cd /tmp/wx && URL=$(curl -fsSL https://api.github.com/repos/watchexec/watchexec/releases/latest | python3 -c 'import json,sys; d=json.load(sys.stdin); print([a["browser_download_url"] for a in d["assets"] if a["name"].endswith("x86_64-unknown-linux-musl.tar.xz")][0])') && curl -fsSLO "$URL" && tar xf *.tar.xz && cp */watchexec ~/.local/bin/
Check that it works
watchexec --versionThe output should contain “watchexec 2.8.0”.
First thing to try
rm -rf /tmp/proj && mkdir -p /tmp/proj/sub/deep && cd /tmp/proj && git init -q && printf 'ignored.txt\n' > .gitignore && echo a > sub/deep/a.txt && echo b > sub/b.txt && echo i > ignored.txt && echo okcd /tmp/proj && (sleep 2; echo x >> sub/deep/a.txt) & cd /tmp/proj && timeout --preserve-status -s INT 5 watchexec --postpone -- echo F1-RAN-ON-CHANGEFrom your project folder, run watchexec --postpone -- <command> to run a command each time a file changes.
What it does
- Run a command when files in a folder changeTested
How to use it
- Open a terminal in your project folder.
- Run
watchexec --postpone -- <command>. - Edit any file in the folder or its subfolders and the command runs.
- Group many quick changes into one runTested
How to use it
- Run
watchexec --postpone -- <command>in your project folder. - Save several files in quick succession. The command runs once for the batch.
- Run
- Skip files listed in .gitignore and .ignoreTested
How to use it
- List files to skip in your project's .gitignore.
- Run
watchexec --postpone --emit-events-to=environment -- '<command>'in the project folder. - Changes to ignored files do not trigger the command. Other changes do.
- Pass changed file paths to your commandTested
How to use it
- Run
watchexec --postpone --emit-events-to=environment -- 'echo $WATCHEXEC_WRITTEN_PATH'to read the changed path from an environment variable. - Or run
watchexec --postpone --emit-events-to=json-stdio -- <command>to send each change as JSON to your command's standard input.
- Run
How far pickfit got
Linux x86_64
- Installs
- Starts
- 4 of 4 features work
- Works offline
macOS and Windows: the project says it runs there; pickfit hasn’t tried it.
Good for
- automatically run unit tests on file changes
- run linters or syntax checkers on change
- rebuild artifacts when sources change
- restart a Python server when Python files change
How pickfit tested it
Each run starts from a clean machine and follows the steps above. How pickfit verifies
Linux x86_64
Its main function works
- Replayed from scratch
- Works offline
- Checked on 15 Nov 2026
- Version 2.8.0
Differences the test machine hit
- README: cargo binstall watchexec-cli / cargo install --locked watchexec-cli
In the test: No Rust toolchain in the box; I used the README's other documented option, the prebuilt binary from GitHub releases (watchexec-2.8.0-x86_64-unknown-linux-musl.tar.xz)