Hot-Reload

Automatically restart services when source files change.

How It Works

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 run default
  api         running  pid 76758
  worker      running  pid 76759

 watch  file changed: api/handlers/users.go
 watch  file changed: api/handlers/users.go
 watch  debounce 300ms

  api         restarting
   stopping pid 76758...
   starting...
  api         running  pid 76801

Configuration

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: 300ms # Wait time after last change
Field Description
include Glob patterns for files to watch within the service directory
ignore Glob patterns for files to exclude from watching
shared Paths outside the service directory — changes here also trigger a restart
debounce Wait time after the last file change before restarting (default: 300ms)

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 run default
 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