Reflex is a file-watching tool that runs a command when files change.
Reflex solves the problem of manually rerunning build, test, or development tasks by automatically triggering commands whenever specified files are modified. It watches the current working directory and reruns your command based on file changes matching patterns you define. You can specify files to watch using shell glob patterns or regular expressions, with support for inverse matching to exclude certain files. The tool ignores common editor and version control files by default. For server-based workflows, the --start-service flag inverts the behavior to run the command on startup and restart it when files change, rather than running it after changes occur.
Reflex suits developers who want lightweight automation for compile, lint, test, or reload tasks during active development. It works well for projects where you need to watch multiple file types with different commands—the configuration file feature lets you define multiple watches in a single file rather than running separate tool instances. The tool is particularly useful for web development where you might rebuild a server, compile stylesheets, and transpile scripts all from one configuration. Reflex is tested on Linux and macOS only. The project provides binary releases and can be installed directly via Go's module system for those with Go 1.16 or later.
The project maintains a focused scope with straightforward command-line and configuration file interfaces. Development activity shows consistent maintenance with attention to core functionality and user-reported issues. The tool remains actively used in development workflows where file-watching automation is needed without the complexity of larger build systems.