Commands
rft watch
Start stacks and auto-restart on file changes
Usage
rft watch [indices...]Starts Docker Compose stacks and watches for changes to the compose file and Dockerfile directories. When a change is detected, affected stacks are automatically restarted.
How It Works
- Runs
rft startto launch all stacks - Watches the compose file and Dockerfile parent directories using filesystem events
- On any change (create, modify, delete), waits 500ms for additional changes (debounce)
- Runs
rft restartto apply changes - Repeats until you press Ctrl+C
Arguments
- indices (optional) — worktree indices to watch. All if omitted.
Examples
# Watch all worktrees
rft watch
# Watch only worktree 1
rft watch 1Output
Watch Starting stacks and watching for changes...
Starting [1] feature/auth (myapp-rft-1-feature-auth)
Started [1] feature/auth
Watch Watching 3 path(s) for changes. Press Ctrl+C to stop.
→ /Users/you/projects/myapp/main/docker-compose.yml
→ /Users/you/projects/myapp/main/frontend
→ /Users/you/projects/myapp/main/backend
Watch File change detected, restarting stacks...Stopping
Press Ctrl+C to stop watching. rft will run rft stop to shut down all watched stacks before exiting.
Debounce
Changes within 500ms are grouped into a single restart. This prevents multiple restarts when saving files rapidly or when editors write temporary files.