watchexec

CLI

Executes commands in response to file modifications.

Re-run commands automatically when files change

3 curated recipes · not yet executed by the harness#watch#rebuild#hot-reload#rust

Recipes

Curated from documentation and usage. Percentages are estimates, not measurements.

Restart server on file change

~97% est.
watchexec -r -- node server.js

Run build on TypeScript change

~96% est.
watchexec -e ts -- pnpm build

Watch specific directory only

~97% est.
watchexec -w src/ -- pnpm test

Install

Homebrewbrew install watchexec
Cargocargo install watchexec-cli

Agent notes

When to use
Auto-restarting dev servers or rebuilding on file save
Quick examples
  • watchexec -r -- cargo run
  • watchexec -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.

Homepage ↗Apache-2.00 views