PHPackages                             hnhdigital-os/fs-watcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. hnhdigital-os/fs-watcher

ActiveProject[CLI &amp; Console](/categories/cli)

hnhdigital-os/fs-watcher
========================

Provides the ability to watch folders for changes and call a binary in response.

2.0.5(5y ago)614MITPHPPHP ^7.3|^8.0

Since Nov 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/hnhdigital-os/fs-watcher)[ Packagist](https://packagist.org/packages/hnhdigital-os/fs-watcher)[ Docs](https://github.com/hnhdigital-os)[ RSS](/packages/hnhdigital-os-fs-watcher/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (8)Versions (25)Used By (0)

FS-WATCHER
==========

[](#fs-watcher)

Provides the ability to watch folders for changes and call a binary in response.

[![Latest Stable Version](https://camo.githubusercontent.com/3462b059253a82a27f78ecb00786b906edc732547689acbc58f22387469f32c3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f686e686469676974616c2d6f732f66732d776174636865722e737667)](https://travis-ci.org/hnhdigital-os/fs-watcher) [![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT) [![Donate to this project using Patreon](https://camo.githubusercontent.com/f9e075baad95563481d35174d43ef50757281abb6bc795d0f473fad452afa030/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617472656f6e2d646f6e6174652d79656c6c6f772e737667)](https://patreon.com/RoccoHoward)

This package has been developed by H&amp;H|Digital, an Australian botique developer. Visit us at [hnh.digital](http://hnh.digital).

Requirements
------------

[](#requirements)

- PHP 7.3 (min)
- php-inotify (`pecl install inotify`)

Installation
------------

[](#installation)

Download the latest build:

`curl -o ./fs-watcher -LsS https://github.com/hnhdigital-os/fs-watcher/raw/master/builds/fs-watcher`

`chmod a+x ./fs-watcher`

Move it local bin:

`sudo mv ./fs-watcher /usr/local/bin/fs-watcher`

Updating
--------

[](#updating)

This tool provides a self-update mechanism. Simply run the self-update command.

`fs-watcher self-update`

How to use
----------

[](#how-to-use)

```
USAGE: fs-watcher  [options] [arguments]
  config            [key] [value]
                   Manage the configuration for this utility.

  self-update      Check if there is a new version and update.
  self-update      [--tag=?]
                   Update this binary to a specific tagged release.
  self-update      [--check-release=?]
                   Returns the current binary version.
  watch:now        [watch-path] [binary-path] [--script-arguments=""]
                   Specify the path to watch, when a file change is detected
                   this utility will call the specified binary at the path with the
                   specific script arguments.
  watch:background [watch-path] [binary-path] [--script-arguments=""]
                   Runs process in the background. Specify the path to watch,
                   when a file change is detected this utility will call the
                   specified binary at the path with the specific script arguments.
  watch:load       Load watchers from a config file.
  watch:list       List all current watchers.
  watch:kill       [pid]
                   Kill a specific process ID for a current watcher.
  watch:kill all   Kills all the watchers.
  watch:log        [pid]
                   View the current log for a specific process ID.
  watch:log        [--where]
                   Returns the path of the log files.
  watch:log        [pid] [--clear]
                   Clears the logs for a specific process ID.
  watch:log        [--clear]
                   Clears all the logs.

```

### watch:now or watch:background

[](#watchnow-or-watchbackground)

For example, if we want to watch for changes in the `/some/folder/example` path and have all changes notified to the executable file `/some/bin/binary-file`.

Note: This utility replaces the following placeholders {{root-path}}, {{file-path}} and {{event-id}} in the script-arguments argument with values. Both path arguments do not need quotations as they will be added automatically.

`fs-watcher watch:background /some/folder/example /some/bin/binary-file --script-arguments="{{root-path}} {{file-path}} {{event-id}}"`

On each file change in the given root folder, the following command execution will occur:

`/some/bin/binary-file "/some/folder/example" "/some/folder/example/new-file" 256`

### watch:load

[](#watchload)

Instead of calling this utility for each folder you want to watch, you can use the `watch:load` command to load a YAML config file.

This config file is in the format:

```
WATCH-PATH:
 - BINARY-PATH: SCRIPT-ARGUMENTS
```

Example:

```
/some/folder/example:
 - /some/bin/binary-file: {{root-path}} {{file-path}} {{event-id}}
```

And then run this to load and start the watcher:

```
fs-watcher watch:load example.yml

```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/hnhdigital-os/fs-watcher/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Rocco Howard](https://github.com/RoccoHoward)
- [All Contributors](https://github.com/hnhdigital-os/fs-watcher/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/hnhdigital-os/fs-watcher/blob/master/LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~37 days

Recently: every ~0 days

Total

24

Last Release

1868d ago

Major Versions

v1.x-dev → 2.0.02021-03-31

PHP version history (2 changes)1.0.0PHP ^7.1.3

2.0.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5270e3a3d1add4e39f12dfde3ce549999a26f759d7128056083ab07f475259f2?d=identicon)[bluora](/maintainers/bluora)

---

Top Contributors

[![RoccoHoward](https://avatars.githubusercontent.com/u/227896?v=4)](https://github.com/RoccoHoward "RoccoHoward (15 commits)")

---

Tags

phpclifilesystemwatcherinotify

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/hnhdigital-os-fs-watcher/health.svg)

```
[![Health](https://phpackages.com/badges/hnhdigital-os-fs-watcher/health.svg)](https://phpackages.com/packages/hnhdigital-os-fs-watcher)
```

###  Alternatives

[seregazhuk/php-watcher

Automatically restart PHP application once the source code changes

394137.8k4](/packages/seregazhuk-php-watcher)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
