Eric Radman
eradman.com · Personal blog · on HN since 2017
Eric Radman writes about Unix tools and BSD systems, and is the author of entr and pg_tmp.
What HN saysCommenters repeatedly praise entr, which reruns commands when files change, for its solid design, cross-platform support, tmux fit, and good documentation.
37HN people shared it
26linked it in comments
14stories submitted
289story points
7 months agolast shared
2017people per year2026
Most-shared posts
- 1Entr: Run arbitrary commands when files change27 people · 8 points · first shared 2018 · 1 comments on HN
- 2Pg_tmp – Run tests on an isolated, temporary PostgreSQL database3 people · 181 points · first shared 2021 · 84 comments on HN
- 3Ephemeral Postgres Databases1 people · 88 points · first shared 2021 · 36 comments on HN
- 4Test-Driven Development in C1 people · 3 points · first shared 2022 · discussion on HN
- 5Automated FreeBSD Install1 people · 2 points · first shared 2026 · discussion on HN
- 6FreeBSD Bhyve and iPXE1 people · 2 points · first shared 2026 · discussion on HN
- 7Running a Linux VM on OpenBSD1 people · 2 points · first shared 2017 · discussion on HN
- 8A stabilized approach to systems orchestration (2020)1 people · 1 points · first shared 2025 · discussion on HN
- 9ZFS Quickstart1 people · 1 points · first shared 2026 · discussion on HN
- 10Handling TCP Connections with Kqueue Event Notification (2018)1 people · 1 points · first shared 2019 · discussion on HN
- 11Entr.11 people · first shared 2020
What HN people wrote when they linked it
somat · 2026-03-28
I love small personal projects like this, especially their writeups. I always have a hard time learning unless I am actually using it for something.
For more software in this domain see also the excellent entr https://eradman.com/entrproject/
wonger_ · 2024-08-31
The author describes the same TUI app workflow I've settled on. Three notes:
- entr is a good livereload tool: https://eradman.com/entrproject/. I prefer to wrap the livereload scripts in a Makefile, under something like `make dev`.
- Managing layout arithmetic by yourself is a real pain. A widget abstraction like Bubbletea's is very helpful. Also, don't forget about weird Unicode characters (eg. emoji) potentially breaking width calculations.
- Since this follows the Elm architecture, consider storing your data the Elm way into one big, flat Model. Elm webapps turn into headaches when you split state among submodels. I think the same happens in TUI apps. I'm glad the author found a solution with a tree of models and message passing. But personally, I'd rather have a Model with 100 fields than the complexity of sumbodels.
macrael · 2021-07-29
I can't sing the praises enough of entr. Just check out its man page: http://eradman.com/entrproject/
entr lets you watch files and re-run a command any time they change. Whenever I'm working on a script, or go tests, or whatever test-like thing I'm doing that's not in its own bloated test harness, I reach for entr. Great software, does what it's supposed to every time.
michael-ax · 2020-07-01
dependency free, solid design, perfect with tmux, great online reference. does not try to do magic:
http://eradman.com/entrproject/
0mp · 2020-07-01
entr is cross-platform and utilizes the best of the platforms it runs on.
Also, the docs are explaining the problems with inotify: http://eradman.com/entrproject/
jamesdutc · 2023-03-22
I recently wrote an autorunner[1] (like Entr[2] and Watchexec[3]) so I have some recent exposure to this problem. (I will be releasing it on Github shortly.) My autorunner allows running interactive programmes, so it is very sensitive to lingering child processes.
For the purposes of the autorunner, I use approach 1.1.3 (“always write down the pid of every process you start, or otherwise coordinate between A and B”) and leave it to the user to figure out what happens if the child process misbehaves with relation to any processes it starts.
However, I want to point out that approach 1.1.4 (“A should run B inside a container”) is easier to do than one might expect, and I'd like to plug one of my favourite utilities—Bubblewrap[4]. The Bubblewrap documentation says “[y]ou are unlikely to use it directly from the commandline, although that is possible” but I have built some amazing little tools from it.
Try the following invocation:
bwrap --ro-bind / / --proc /proc --unshare-pid ps
This launches `ps` in a PID namespace with a new `/proc` (since `ps` will read from the host proc otherwise) and the root filesystem mounted readonly. Any procesesses within the PID namespace should have been created by the immediate command that `bwrap` launched. There are also flags `--die-with-parent` and `--as-pid-1` which can further reduce runtime overhead. If you really need a supervisor process, this can be as simple as a `/bin/sh` script that `kill TERM --timeout 1000 KILL` in a loop…
tony · 2022-06-27
Wow. I wasn't expecting anything like a filesystem monitor in git(1) itself.
They post says Jeff Hostetler, the author of the patches, will make a blog post delving into it. So it's worth bookmarking that post and swinging back. It's bound to be an interesting one!
Apparently git 2.16 had a fsmonitor hook for external filewatcher like watchman (it got passed me): https://github.com/git/git/commit/def4376711f607914bfb784f8de21867062f…
This kind of change needs to be tailored to the platform, it says just Mac (FSEvents?) and Windows (ReadDirectoryChangesW?) for now. So can we expect Linux (inotify?) and BSD (kqueue*) in the future?
Anyway, I hope this venture is fruitful. The premise of having cross-platform file watching without needing an extra application is delightful.
Thank you Jeff!
* I believe one area that may be tricky is kqueue, I believe it has limits in watching directories, needing a file descriptor for each file.
P.S. I would like to drop a link to entr(1), a lightweight cross platform file watcher: https://eradman.com/entrproject/
hardwaresofton · 2021-04-21
Lots of ways! So this is one of those things that's subtly quite interesting -- Make will both take all variables from the environment, and make them Make variables. So this command:
$ USER=my_name make psql
The above example is the creation of a temporary ENV variable (assuming your shell supports this feature, it's equivalent to doing an export but only for that line), and the USER variable (accessed by using $(USER) or ${USER} in your makefile somewhere) will be automatically populated.
That is distinct from the following:
$ make psql USER=my_name
What you've done there is actually make-specific, you're giving make a Make variable, so Make will know about $(USER)/${USER}, and it will also show up, because Make exposes it's variables to shells (each line is it's own shell) that is run[0]. So this Makefile:
.PHONY: my-tgt
my-tgt:
echo -e "double dollar to print a bash var => $$MYVAR"
Produces the same thing -- $$MYVAR is actually a way to use a shell variable (the $ has to be escaped), but you get the same result putting USER= before and after:
$ MYVAR=from-the-shell make my-tgt
double dollar to print a bash var => [from-the-shell]
$ make my-tgt MYVAR=from-make
double dollar to print a bash var => [from-make]
All…
dinosaurdynasty · 2024-12-30
https://eradman.com/ephemeralpg/ (for Postgres) plus making sure your test suite is parallel works wonders.
jweir · 2023-05-23
Since we are mentioning these, I use entr
# Makefile
test:
`find * -name "*.go" | entr bash -c "clear; go test ./..."`
https://eradman.com/entrproject/
flobosg · 2022-08-15
See also:
* entr(1) - http://eradman.com/entrproject/
* Watchexec - https://watchexec.github.io/
unhammer · 2022-06-16
is `dotnet watch` basically `git ls-files|entr dotnet build` ?
(entr is http://eradman.com/entrproject/ – like inotifywait but easier)
sidpatil · 2022-02-11
For those who don't feel like Googling it: http://eradman.com/entrproject/
carreau · 2022-01-12
May I suggest to look at https://eradman.com/entrproject/ ? It's like watch but triggers only when it detect file changes.
cjw3 · 2021-10-26
We use this for TypeScript development at my company. Using swc for transpilation reduces build time from ~10s (small-ish codebase) to near instant. We can then wrap it in entr [1] to get live API reloading for free.
For type checking, you can run the TypeScript compiler in another window in watch mode, or just rely on editor warnings until the code hits CI.
[1]: https://eradman.com/entrproject/
whateveracct · 2021-10-24
You can usually script the database setup and teardown and have the test suite use the same scripts you have available in a nix-shell.
pg_tmp [1] also helps
http://eradman.com/ephemeralpg/
leetrout · 2021-08-01
http://eradman.com/entrproject/
find . -name "*.go" | entr -r go run my/main/file.go
eysi · 2021-05-31
Garden[1] is a tool we built (yes, I'm affiliated :)) that has a lot of this functionality built-in. Might fit your use case.
We recently re-wrote the hot reload functionality to use Mutagen[2] under the hood and it's insanely fast (<200ms anecdotally). It also does two way sync which can be useful. The old implementation used rsync but a lot of our Windows users struggled with that. So I figured I'd share in case that sounds familiar.
What happens after a sync event depends on the stack, but we've had pretty good success with Entr[3]. We often have it watch a single file so that multiple watchers in a shared dev cluster don't eat up all the node's resources.
1: https://github.com/garden-io/garden
2: https://mutagen.io/
3: http://eradman.com/entrproject/
oefrha · 2021-03-30
I just use entr[1] with pandoc -s --katex.
[1] http://eradman.com/entrproject/ A generic watcher.
diurnalist · 2021-02-04
Looks interesting, I like that it's packaged as a single binary so it's easier to install. The idea to have default behaviors for different extension types is also cool. I've used entr[1] in the past--did you have a look at that tool? There seems to be some trickiness with things like "-r" to work properly in as many cases as possible. I also had an issue where it was hard to run entr in a Docker container on Mac due to some inotify issues or something. You may need to watch out for that!
Thanks for sharing :)
[1]: http://eradman.com/entrproject/
RMPR · 2020-09-23
For markdown I don't use/need a plugin, with entr[0] and Pandoc you can emulate the live preview feature easily, without even needing a browser.
0: http://eradman.com/entrproject/
akx · 2020-07-01
That's literally in the article; `entr -d`. The manpage also has an entry. http://eradman.com/entrproject/entr.1.html#d
stock_toaster · 2020-06-14
entr[1] is another good option.
[1]: http://eradman.com/entrproject/
Groxx · 2020-04-13
Probably git, 1password (though I'm planning to shift to Bitwarden), and entr: http://eradman.com/entrproject/
Having a simple standard way to automate all of my modify->"do x" runs has been wonderful, and (with a bit of care in your project structure) being able to near-livecode in almost any language is an incredible productivity boost.
felixhummel · 2020-02-28
If you like inotify, you might also like entr [1].
I only found out about it few days ago, but it seems nice so far.
[1]: http://eradman.com/entrproject/
boulos · 2018-12-25
Ha! I took too long to format my response :). The entr examples from [1] seem to do the same (ls *.rb for example).
[1] http://eradman.com/entrproject/