Watch Mode

Automatically push when tracked files change

Starting Watch Mode

Watch mode monitors all tracked files using filesystem events. When a change is detected, it automatically pushes the updated state to the cloud.

Terminal

configsync watch

Press Ctrl+C to stop watching.

Options

--debounce <ms>Debounce interval in milliseconds (default: 5000)
--filter <items>Watch only specific items (see Selective Sync)
-m <msg>Message template for auto-push snapshots

Examples

Terminal

# Watch with a shorter debounce

configsync watch --debounce 2000

# Watch only config files

configsync watch --filter configs

# Watch with a custom message

configsync watch -m "auto-sync"

How It Works

Watch mode uses fs.watch() to monitor tracked files for changes. When a file is modified:

  1. The change is debounced to batch rapid edits into a single push
  2. Content hashing compares the file against its last-pushed state
  3. If the content actually changed, a push is triggered with --changed semantics
  4. No-op changes (e.g., saving without edits) are skipped
i
Watch mode shows live status output indicating which files changed and when pushes occur.