Watchexec File Watcher

Watchexec File Watcher

github.com

2

About this website

Watchexec is a free and open-source command-line tool that watches files and directories for changes and executes a command in response. Created by Matt Green (greenfork) and maintained since 2017, Watchexec is written in Rust and designed for development workflows that require automatic rebuilding or reloading when files change. Key features: file watching: monitors files for create, write, remove, rename, chmod events using platform-native APIs (inotify on Linux, kqueue on BSD/macOS, ReadDirectoryChangesW on Windows, FSEvents on macOS), providing near-instant notification without polling. Path filtering: specify watch paths (-w), file extensions (-e), and ignore patterns (-i). For example, watchexec -w src -e rs watches only Rust files in src. Command execution: the command to run follows as arguments (watchexec cargo build). Shell commands with pipes, redirection, and environment variables are supported. Debouncing: configurable delay (default 100ms) prevents multiple runs from rapid changes. Restart mode (-r): kills and restarts the command if still running, ideal for long-running processes like servers. Clear screen (-c): clears terminal before each run. Signal handling: sends configurable signals (default SIGTERM) for graceful shutdown. Cross-platform. Rust. Apache-2.0.

Tags & Categories

Statistics

2
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!