Skip to content

AnuchitO/re

Repository files navigation

re

Reruns a command automatically whenever files change. Built for tight feedback loops like TDD.

re go test -v ./...

Installation

go install github.com/AnuchitO/re@latest

Make sure $GOPATH/bin (or $HOME/go/bin) is in your PATH.

Usage

re [flags] <command> [args...]

Examples

Run tests on every file change:

re go test -v ./...

Restart an API server on every change:

re go run main.go

Clear the screen, poll every 300ms, ignore log files:

re -clear -interval 300ms -ignore "*.log,vendor" go test ./...

Flags

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

.gitignore patterns are respected automatically — no extra configuration needed.

Design

Key decisions — polling vs OS events, WalkDir, gitignore caching, process group killing, terminal detection — are documented with full context and reasoning in ADR.md.

Features

  • Rerun any command on file change
  • Kill entire process group on rerun (not just the top-level process)
  • Respect .gitignore with 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

Contributing

Pull requests are welcome.

License

MIT

About

re is a program for rerun your command when files change with a focus on simplicity.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors