Restarts on file changes
Watches your files with gitignore-style patterns and debouncing, so saving 20 files means one restart.
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 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
$ 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 0A typical config:
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.