Hot-Reload

Edit a file, save, fuku restarts the affected service. Debouncing prevents storms. Shared paths handle cross-service deps.

How it works

Native fsnotify, debounced

fuku watches file system events in your service directories and restarts the affected service when matching files change. A debounce timer prevents restart storms when multiple files change at once (e.g., during a git checkout).

fuku · hot-reload
│ ✓ api         running  pid 76758
│ ✓ worker      running  pid 76759
│
│ watch  file changed: api/handlers/users.go
│ watch  file changed: api/handlers/users.go
│ watch  debounce 500ms
│
│ ○ api         restarting
│   stopping pid 76758...
│   starting...
│ ✓ api         running  pid 76801
Configuration

Per-service watch config

fuku.yaml
services:
  api:
    dir: ./api
    watch:
      include: ["**/*.go"] # Glob patterns to watch
      ignore: ["**/*_test.go"] # Patterns to ignore
      shared: ["pkg/common"] # Shared paths (triggers restart)
      debounce: 500ms # Wait time after last change
FieldDescription
includeGlob patterns for files to watch within the service directory
ignoreGlob patterns for files to exclude from watching
sharedPaths outside the service directory – changes here also trigger a restart
debounceWait time after the last file change before restarting (default: 500ms)
Cross-service

Shared paths

If multiple services depend on a shared library (e.g., pkg/common), add it to shared. When files in that path change, the service restarts – even though the files are outside its own directory.

fuku.yaml
services:
  api:
    dir: ./api
    watch:
      include: ["**/*.go"]
      shared: ["pkg/common", "pkg/models"]

  worker:
    dir: ./worker
    watch:
      include: ["**/*.go"]
      shared: ["pkg/common"]
fuku · shared paths
│ watch  file changed: pkg/common/auth.go
│ watch  shared path match → api, worker
│
│ ○ api         restarting
│ ○ worker      restarting
│ ✓ api         running  pid 76820
│ ✓ worker      running  pid 76821

Ready to try it out?

Get Started