watchers-1.5.0 is not a library.
Visit the last successful build:
watchers-0.1.0
Watchers
A CLI tool for managing file system watchers that automatically create git commits when files change. Each watcher runs as a systemd user service, allowing you to monitor multiple directories simultaneously.
Features
- Multiple named watchers: Create and manage multiple watchers, each monitoring a different directory
- Debounced commits: Only creates commits after file activity stops
- Automatic push: Optionally push commits to remote repository
- Systemd integration: Watchers run as background services with automatic restart
Installation
or
Build from source:
Quick Start
- Create a new watcher:
# You'll be prompted for the directory path to watch
-
The watcher is now running! It will:
- Monitor the specified directory for file changes
- Wait for the configured delay after changes stop
- Automatically create a git commit
- Push to remote if
auto_pushis enabled
-
Manage your watchers:
# List all watchers
# Stop a watcher
# Start a watcher
# Delete a watcher
Configuration
Watcher configurations are stored as YAML files in ~/.config/watchers/<name>.yml:
name: my-project
watch_dir: /path/to/your/project
commit_delay_secs: 60 # Wait 60 seconds after last change
auto_push: true # Automatically push commits
You can manually edit these files to adjust settings, then restart the watcher:
How It Works
- Each watcher runs as a systemd user service (
watchers@<name>.service) - The service monitors the configured directory for file changes
- When changes occur a timer is started
- If no changes occur for
commit_delay_secsseconds then the changes are committed - If
auto_pushis enabled, the commit is pushed to the remote repository
Development
# Build
# Run a command
# Run with debug logging
RUST_LOG=debug
# Format code
# Run linter
Requirements
- Linux with systemd (uses systemd user services)
- Git repositories in watched directories