CommandCross-platform

Phantom Watch

Watch Files and Re-run Command on Change

Automatically re-runs a command whenever specified files change. Useful for running tests, rebuilding assets, or restarting servers during development.

find . -name "*.js" | entr -c npm test

Usage Notes

  • -c clears the screen before each run
  • -r restarts long-running processes (servers, watchers)
  • -s uses shell to interpret the command
  • Pipe any file list to entr; combine with find, git ls-files, or fd
  • Install with brew install entr (Mac) or apt install entr (Linux)

Warnings

None

Related Scroll Ideas

  • • Watch and rebuild TypeScript on change
  • • Restart Node server on file modification
  • • Run linter automatically on save