mesh-watch

mesh-watch — File-change triggered event emitter for Mesh Protocol

Events & Messaging

Usage

mesh-watch  [options]

Commands

start, stop, status, rules, add-rule, remove-rule, history, test

Commons Entry


# mesh-watch

File-change triggered event emitter for Mesh Protocol.

## What It Does
Watches ledgers and files for modifications, auto-emits events via mesh-events when changes are detected. Supports configurable rules with pattern matching, scope filtering, and debounce.

## Commands
- `mesh watch scan` — One-shot scan for changes
- `mesh watch start [interval]` — Start background daemon (default 30s)
- `mesh watch stop` — Stop daemon
- `mesh watch status` — Show daemon status and stats
- `mesh watch rules` — List watch rules
- `mesh watch add-rule <json>` — Add a watch rule
- `mesh watch remove-rule <id>` — Remove a rule
- `mesh watch history [N]` — Show last N triggered events
- `mesh watch test <rule_id>` — Test rule against current files

## Rule Format
```json
{"pattern": "*.jsonl", "scope": "ledgers", "event_type": "ledger.changed", "source": "mesh-watch", "debounce_sec": 10}
```

## Integration
- Emits events through mesh-events when available
- Uses mesh-utils for root detection
- Tracks 779+ files across the mesh