REFLEX(1)
π REFLEX β ok so like, the manual but make it make sense π
bestie. you're reading the reflex manual page, section 1, from USER COMMANDS. it's a tiny little tool with main character energy and i'm about to tell you everything about it. no skips, no "you'll figure it out", we're doing the whole thing. π«Ά
β¨ NAME β¨
Reflex β run a command when files change. that's it. that's the whole vibe. π¦
β¨ SYNOPSIS β¨
reflex [OPTIONS] [COMMAND]
literally just options and then a command. that's the whole shape of it. π
β¨ DESCRIPTION β¨
okay so listen. Reflex is a small tool that watches a directory and reruns a command whenever certain files change. it's giving "i will personally babysit your filesystem and yell at your build the second something moves." π
and it is so good for automatically running your compile / lint / test tasks β like, the boring stuff you keep forgetting to do β and for reloading your application whenever the code changes. set it and forget it, fr fr. πΈ
β¨ OPTIONS β¨
here's the whole menu. every single one. i'm not gatekeeping anything. π
--all=True|Falseβ include the files that are normally ignored (you know, the VCS and editor special files π). defaults toFalse.-c,--config=FILEβ a configuration file that describes how to run reflex. or, if you're feeling spicy, pass-and it'll read the config straight from stdin. β¨-d,--decoration=DECORATIONβ how to decorate the command's output. the choices arenone,plain,fancy. default isplain. π-g,--glob=GLOB_LISTβ a shell glob expression to match filenames. (may be repeated. stack 'em up bestie.) π-G,--inverse-glob=GLOB_LISTβ a shell glob expression to exclude matching filenames. the inverse. the anti-glob. (may be repeated.) π-R,--inverse-regex=REGEXβ a regular expression to exclude matching filenames. (may be repeated.) π«--only-dirs=True|Falseβ only match directories, not files. defaults tofalse.--only-files=True|Falseβ only match files, not directories. defaults tofalse.-r,--regex=REGEXβ a regular expression to match filenames. (may be repeated.) π₯-e,--sequential=True|Falseβ don't run multiple commands at the same time. one at a time, we wait our turn. defaults tofalse.-t,--shutdown-timeout=TIMEOUTβ allow services this long to shut down. defaults to500ms.-s,--start-service=True|Falseβ this says "hey, this command is a long-running process, restart it whenever matching changes happen." defaults tofalse.--substitute=STRINGβ the substitution symbol that gets replaced with the filename inside a command. defaults to"{}".-v,--verbose=True|Falseβ verbose mode: print out more info about what reflex is doing. nosy mode. i love it. defaults tofalse.
β¨ EXAMPLES β¨
okay now the fun part, the actual use cases. β
print each .txt file if it changes:
reflex -r '\.txt$' echo {}
run make(1) if any of the .c files in this directory change:
reflex -g '*.c' make
build and run a server; rebuild and restart when .java files change:
reflex -r '\.java$' -s -- sh -c 'make && java bin/Server'
no cap, that last one is the whole "live reload" fantasy and it's just three flags deep. iconic. π
π and that's the page π
this was reflex, version 0.2.0+git20181022.3d..., dated October 29, 2018. yes, an oldie but a goodie, and it's still serving. go watch some files, bestie, you've got this. ππ¦β¨π
π¦ where this page comes from
- debian bookworm: reflex 0.3.1-1+b6 Β· MIT
- debian trixie: reflex 0.3.1-1+b17 Β· MIT
- ubuntu jammy: reflex 0.3.1-1 Β· MIT
- ubuntu jammy: reflex 0.3.1-1ubuntu0.22.04.1 Β· MIT
- ubuntu noble: reflex 0.3.1-1build1 Β· MIT
- ubuntu noble: reflex 0.3.1-1ubuntu0.24.04.3 Β· MIT
- ubuntu questing: reflex 0.3.1-1build1
- ubuntu resolute: reflex 0.3.1-1build2 Β· MIT
- ubuntu stonking: reflex 0.3.2-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms