Add reload
in front of your command to automatically rerun the command when you make file changes.
reload
uses the following heuristics:
- If there are any files present in the command, it watches those files
- If no files are present, it watches the whole current directory
If you have a command pipeline, using &&
or ||
, you'll need to quote the command.
reload python3 main.py
reload 'gcc main.c && ./a.out'
reload make
go install github.com/vegarsti/reload@latest
reload
uses the fsnotify cross-platform filesystem notification library which supports macOS, Windows, Linux, and others.