Watchman: Execute a command when something changes

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • entr

    A utility for running arbitrary commands when files change. Uses kqueue(2) or inotify(7) to avoid polling. entr responds to file system events by executing command line arguments or by writing to a FIFO. entr was written to provide to make rapid feedback and automated testing natural and completely ordinary. (by clibs)

  • Not sure what generated interest in this.

    This was a project I did for my personal use case. But I haven't been using it since years. I'd recommend [entr](https://github.com/clibs/entr) for the use case watchman was to serve.

  • watchman

    Execute a command when something changes (by crodjer)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • watchman

    Watches files and records, or triggers actions, when they change.

  • Not to be confused with Facebook’s file watch daemon, which does the same sort of thing but is more complicated. There’s a bunch of tools that integrate Facebook’s watchman for more efficient change tracking.

    https://facebook.github.io/watchman/

  • incron

    cron-like daemon which handles filesystem events

  • I've used `incron`[0] for that purpose, with success

    [0]https://github.com/ar-/incron

  • fswatch

    A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.

  • The required kernel hooks exist in pretty much any common OS these days, it is a user-space tool that is sometimes missing.

    It may not be installed by default, but inotifywait is available in common Linux distributions, usually in a package called something like ionotify-tools, and has been for over a decade-ana-half IIRC. It'll work under WSL on Windows too, though only for ext4 devices not bits of the Windows filesystem made available to Linux.

    I can't speak to what other OSs include by default, but as every major OS has a different API for defining how to register a lister and how it gets messages no built-in tool is going to be cross platform. There are third party tools which present more cross-platform consistency, most notably https://github.com/emcrisostomo/fswatch#readme (also available in common Linux distros, just an apt install away in Debian for instance).

  • watchdog

    Python library and shell utilities to monitor filesystem events.

  • Also not to be confused with watchdog and it's command watchmedo, which is what I thought this was when I first read the headline. I don't know what the differences are, but I use this to restart my local celery workers when I make changes. It's scripted out so I don't ever use the command directly.

    https://pypi.org/project/watchdog/

    https://github.com/gorakhargosh/watchdog

  • reflex

    Run a command when files change (by cespare)

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • WatchMod

    Watch for modifications to trigger actions. Useful for compiling Go templates, Sass, Typescript, and more.

  • Here was our take on the problem written in Go.

    https://github.com/Cyphrme/watch

    {

  • watcher

    Filesystem watcher. Works anywhere. Simple, efficient and friendly. (by e-dant)

  • Those considering doing something like this (such as the author) might consider using my library:

    https://github.com/e-dant/watcher

    It hooks into system APIs where viable. (Otherwise, it uses std::filesystem.)

    It’s meant to be as or more:

    Easy to use

  • entr

    Run arbitrary commands when files change

  • The page linked above says:

    > WARNING: This is a (possibly outdated and/or unmaintained) fork of https://github.com/eradman/entr .

  • fwe

    File Watch Execute

  • I wrote something very similar.

    https://github.com/m00dy/fwe

  • dotfiles

    :octocat: Tim does dotfiles (by timvisee)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts