home / dev-tools / entr

entr

5.5k

File watcher CLI that reruns commands or restarts a child process when watched files change.

$./configure && make test && make install
Language
C
Stars
5,483
Category
Dev Tools
Agent
AI Analysis

entr watches a list of files from stdin and runs a command when one of them changes. It is a small local-development primitive for rebuild, test, query, or server-reload loops without polling.

What It Enables
  • Re-run tests, builds, linters, or database queries whenever a watched file changes.
  • Restart a long-lived process such as a dev server or worker with -r, so code changes trigger a clean reload.
  • Watch parent directories for added or removed files with -d and pass the first changed path into the command with /_.
Agent Fit
  • Works well as shell glue around other CLIs because commands, flags, exit behavior, and stdin-driven file lists are simple and predictable.
  • -n gives a non-interactive mode and -z can return the child process status, but there is no JSON or other structured output to inspect.
  • Best for local edit-build-test or auto-reload loops where an agent wants the shell to stay reactive between file changes.
Caveats
  • It only watches the file list you pipe in; recursive discovery and glob refresh usually come from find, ls, or a surrounding shell loop.
  • Default mode opens a TTY for the child process, so unattended usage should generally opt into -n and use commands that behave well when restarted.