LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

reflex

Run commands when files change

TLDR

Watch and run command
$ reflex [command]
copy
Watch specific pattern
$ reflex -r '\.go$' [go build]
copy
Watch directory
$ reflex -d [src/] [command]
copy
Multiple patterns
$ reflex -r '\.go$' -r '\.html$' [command]
copy
Start without initial run
$ reflex -s [command]
copy
Decoration mode
$ reflex -d [.] -- [sh -c "echo changed"]
copy
Exclude pattern
$ reflex -r '\.go$' -R 'vendor/' [command]
copy

SYNOPSIS

reflex [-r regex] [-d dir] [-R exclude] [options] command

DESCRIPTION

reflex watches files and runs commands on changes. It's a flexible file watcher for development.Regex patterns filter which files trigger. Multiple patterns combine for complex matching.Service mode runs a long-running process. The process restarts on changes.Exclusions ignore vendor directories or build output. Prevents unnecessary rebuilds.Configuration files define complex watch rules. Multiple watchers in one file.

PARAMETERS

-r REGEX

Include pattern.
-R REGEX
Exclude pattern.
-d DIR
Watch directory.
-s
Start service (no initial run).
-g GLOB
Glob pattern.
-c CONFIG
Config file.
--all
Match all files.
--decoration MODE
Output decoration.

CONFIGURATION

.reflex

Project-level configuration file defining watch rules, one per line, with regex patterns and commands. Loaded automatically when present in the current directory.

INSTALL

sudo apt install reflex
copy
sudo apk add reflex
copy
brew install reflex
copy
nix profile install nixpkgs#reflex
copy

CAVEATS

Polling fallback on some filesystems. Rapid changes may batch. Initial run may not be wanted.

HISTORY

Reflex was created as a simple, flexible file watcher. It focuses on development workflow automation with minimal configuration.

SEE ALSO

entr(1), watchman(1), fswatch(1), inotifywait(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid