Skip to content

watchddocker compose for local processes

Run every app of your projects from one Lua config. watchd restarts them when files change or when they crash, starts them in the right order, and lets you control everything from one CLI.

watchd

watchd is in beta

Every feature works and is covered by tests, but watchd is young and hasn't been used widely yet. Expect rough edges, and the config format or commands may change before version 1.0. What this means ยท Report a problem

Thirty seconds to running โ€‹

console
$ cd ~/work/shop
$ watchd up
No watchd.lua found in ~/work/shop or its parents. Let's create one.
  โœ“ api  go run .      ./api
  โœ“ web  pnpm run dev  ./web
โœ“ Created ~/work/shop/watchd.lua for project shop with 2 app(s)
shop: started api, web

$ watchd ps
PROJECT  APP  STATE              PID    UPTIME  RESTARTS
shop     api  running (healthy)  41233  8s      0
shop     web  running            41260  7s      0

A typical config:

lua
return {
  name = "shop",
  apps = {
    {
      name = "api",
      cmd = "go run ./cmd/api",
      watch = { "**/*.go" },
      healthcheck = { http = "http://127.0.0.1:8080/health" },
    },
    {
      name = "web",
      cmd = "npm run dev",
      cwd = "./web",
      depends_on = { "api" },
      env = { PORT = 3000 },
    },
  },
}

Any language works, because an app is just a shell command. watchd is a single static binary for Linux and macOS, with no Node.js, Python, Docker or tmux required.

Released under the MIT License.