watchexec
CLIExecutes commands in response to file modifications.
Re-run commands automatically when files change
Recipes
Curated from documentation and usage. Percentages are estimates, not measurements.
Restart server on file change
watchexec -r -- node server.jsRun build on TypeScript change
watchexec -e ts -- pnpm buildWatch specific directory only
watchexec -w src/ -- pnpm testInstall
Homebrew
brew install watchexecCargo
cargo install watchexec-cliAgent notes
- When to use
- Auto-restarting dev servers or rebuilding on file save
- Quick examples
watchexec -r -- cargo runwatchexec -e ts -- pnpm build
Use from an agent
curl -s https://clihub.com/api/tools/watchexec | jq '.agentHints.provenRecipes[] | {task, command, verified}'Or call get_tool with slug watchexec on the MCP server at https://clihub.com/mcp.