Reruns a command automatically whenever files change. Built for tight feedback loops like TDD.
re go test -v ./...
go install github.com/AnuchitO/re@latestMake sure
$GOPATH/bin(or$HOME/go/bin) is in yourPATH.
re [flags] <command> [args...]
Run tests on every file change:
re go test -v ./...Restart an API server on every change:
re go run main.goClear the screen, poll every 300ms, ignore log files:
re -clear -interval 300ms -ignore "*.log,vendor" go test ./...| Flag | Default | Description |
|---|---|---|
-interval |
800ms |
How often to poll for file changes |
-ignore |
— | Comma-separated glob patterns to skip (e.g. *.log,vendor) |
-clear |
false |
Clear the terminal before each rerun |
-version |
— | Print version and exit |
.gitignorepatterns are respected automatically — no extra configuration needed.
Key decisions — polling vs OS events, WalkDir, gitignore caching, process group killing, terminal detection — are documented with full context and reasoning in ADR.md.
- Rerun any command on file change
- Kill entire process group on rerun (not just the top-level process)
- Respect
.gitignorewith cached pattern matching - Watch nested directories
- Clear screen before rerun (
-clear) - Configurable poll interval and ignore patterns
- Terminal-aware output with plain ASCII fallback
- Version flag (
-version) - Full cross-platform CI coverage
Pull requests are welcome.