Skip to content

moughamir/inowatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inowatch — File Watch Daemon

AGPL-3.0-only GitHub zread

Watches filesystem changes via inotify and emits structured events to stdout as NDJSON (newline-delimited JSON). Also ships a Model Context Protocol mode for JSON-RPC 2.0 integration.


Installation

$ cargo install --git https://github.com/moughamir/inowatch

Or build from source:

$ git clone https://github.com/moughamir/inowatch
$ cd inowatch
$ cargo build --release

Usage

$ inowatch [OPTIONS] <PATH>...

Watch one or more paths and print coalesced events to stdout:

$ inowatch /var/log
{"timestamp":"2026-06-08T12:00:00.000000000Z","seq":1,"events":[{"type":"create","path":"/var/log/nginx/access.log","info":{"size":0,"mode":"0644","is_dir":false}}]}

Options

Flag Description
-d Fork into background (daemon mode).
-p <FILE> Write PID to file (implies -d).
--debounce <MS> Coalescing window in milliseconds (default: 500).
--no-recursive Do not watch subdirectories recursively.
-q Suppress the startup banner record.
--mcp Run in MCP mode (see below).

All paths are watched recursively by default.

MCP Mode

--mcp puts fwd in Model Context Protocol mode — it speaks JSON-RPC 2.0 over stdin/stdout, exposing filesystem events as MCP resources. This mode is incompatible with -d, -p, and -q.

$ inowatch --mcp

Output Format

Standard mode emits one NDJSON line per batch of coalesced events:

{
  "timestamp": "2026-06-08T12:00:00.000000000Z",
  "seq": 1,
  "events": [
    {
      "type": "create|modify|delete|rename",
      "path": "/some/file",
      "cookie": null,
      "info": { "size": 1024, "mode": "0644", "is_dir": false }
    }
  ]
}

The first line may be a "type":"banner" record with the daemon version, PID, watched paths, and debounce setting.


License

AGPL-3.0-only. See LICENSE.

About

FileWatch Daemon

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages