talira

watchexec

Executes commands in response to file modifications

open sourceApache-2.0self-hostablefree

watchexec watches a path and runs a command whenever it detects changes. It coalesces bursts of filesystem events, honours .gitignore and .ignore, uses process groups to keep hold of forking programs, can restart long-running servers, and passes the changed paths in environment variables or stdin. It is language-agnostic and runs on macOS, Linux and Windows.

Ways to install

Problems it solves

  • rerun my tests automatically every time I save a file
  • restart my dev server when source files change
  • nodemon but for any language, not just Node
  • entr needs a find pipeline and does not restart servers well
  • rebuild assets when CSS or HTML files change
  • file watcher that ignores everything in .gitignore
  • editors that write temp files trigger my watcher several times
  • run a linter on change across Mac, Linux and Windows

Features

  • event coalescing
  • .gitignore support
  • restart mode
  • process group handling
  • changed paths in env/stdin
  • filters by extension

Capabilities

Has a command line toolplan not known

Alternatives

The same job

These do what watchexec does.

  1. entr Run arbitrary commands when files change
  2. bacon Background code checker
  3. just Just a command runner
  4. Task A fast, cross-platform build tool inspired by Make, designed for modern workflows.
  5. Air Live reload for Go apps

Compare watchexec with the top 3