Loading...
Loading...
Watch files and directories for changes. Execute commands on change. Support for create, modify, delete events. No API key required.
npx skill4agent add winsorllc/upgraded-carnival file-watcher{baseDir}/watch.sh <directory> --command "echo 'Changed'"
{baseDir}/watch.sh ./src --command "npm run build"
{baseDir}/watch.sh ./logs --command "./process.sh" --pattern "*.log"{baseDir}/watch.sh --file config.json --command "echo 'Config changed'"
{baseDir}/watch.sh --file /var/log/app.log --command "tail -5 /var/log/app.log"{baseDir}/watch.sh --files "file1.txt,file2.txt,file3.txt" --command "echo 'Changed'"
{baseDir}/watch.sh --files-from list.txt --command "echo 'Changed'"{baseDir}/watch.sh ./src --command "make" --events create,modify,delete
{baseDir}/watch.sh ./src --command "make" --events create
{baseDir}/watch.sh ./src --command "make" --events modify{baseDir}/watch.sh ./src --command "make" --daemon
{baseDir}/watch.sh ./src --command "make" --pidfile /tmp/watcher.pid{baseDir}/watch.sh ./src --command "npm run build" --debounce 2
{baseDir}/watch.sh ./src --command "npm run build" --debounce-file| Option | Description | Default |
|---|---|---|
| Command to run on change | Required |
| Watch single file | None |
| Watch multiple files | None |
| Read file list from file | None |
| File pattern to match | |
| Events: create,modify,delete | all |
| Watch subdirectories | true |
| Don't recurse | false |
| Debounce time | 0 |
| Debounce per file | false |
| Run in background | false |
| PID file for daemon | None |
| Stop after N seconds | None |
| Suppress output | false |
| Show all events | false |
| Event | Description |
|---|---|
| File or directory created |
| File content modified |
| File or directory deleted |
| File moved (renamed) |
| File accessed (read) |
| File attributes changed |
[2026-02-25 20:41:00] MODIFY /path/to/file.txt
Running: echo 'Changed'
...
[2026-02-25 20:41:01] CREATE /path/to/newfile.txt
Running: echo 'Changed'
...--json{"event": "MODIFY", "file": "/path/to/file.txt", "timestamp": "2026-02-25T20:41:00Z", "command_output": "..."}{baseDir}/watch.sh ./src --command "npm run build" --debounce 1{baseDir}/watch.sh ./logs --command "./new-log.sh" --events create{baseDir}/watch.sh --file config.json --command "pm2 restart app"{baseDir}/watch.sh --files "config.json,.env,package.json" --command "npm run build"{baseDir}/watch.sh ./src --command "make" --daemon --pidfile /tmp/watcher.pid{baseDir}/watch.sh ./uploads --command "echo 'File deleted'" --events delete--debounce--debounce N--debounce-file# Wait 2 seconds after last change
{baseDir}/watch.sh ./src --command "build.sh" --debounce 2
# Debounce per file (each file gets its own timer)
{baseDir}/watch.sh ./src --command "process.sh" --debounce-file --debounce 1$FILE$EVENTinotifywaitfswatch