For CLI usage I found that the best option was instead of watching my source directory just to watch a magic file. Then I configured my editor to touch that file when saving. This has a few benefits:
1. No need to worry about which files to watch or ignoring build outputs.
2. Works with every project with no setup.
3. Easy to trigger a re-run without actually changing a file.
4. Always runs after all files are saved instead of starting after the first file is saved and racing the rest.
I'm currently using neovim so it is pretty trivial to add save hooks. Although the approach I am currently using is just a custom shortcut that saves all files and touches the file. This way only explicit saves by me trigger the rerun.
1. No need to worry about which files to watch or ignoring build outputs.
2. Works with every project with no setup.
3. Easy to trigger a re-run without actually changing a file.
4. Always runs after all files are saved instead of starting after the first file is saved and racing the rest.
5. Infinitely scalable.