Arelo executes the specified command and monitors the files under the target directory. When the file that matches the pattern has been modified, restart the command.
- Simple command line interface without config file
- Monitoring file patterns are specified as glob
- globstar (**; matches to zero or more directories) supported
- can match the no extention filename
- can match the hidden filename which starts with "."
- Safely terminate child processes
- Any command line tool can be executed
- not only go project
- can execute shell script
- No unnesesary servers
- no need to use local port unlike http server
go install github.com/makiuchi-d/arelo@latest
Or, you can download the executable binaries from the release page.
To get a static-linked executable binary, build with CGO_ENABLED=0
.
Run this command in your Go project directory.
arelo -p '**/*.go' -i '**/.*' -i '**/*_test.go' -- go run .
Usage: arelo [OPTION]... -- COMMAND
Run the COMMAND and restart when a file matches the pattern has been modified.
Options:
-d, --delay duration duration to delay the restart of the command (default 1s)
-f, --filter event filter file system event (CREATE|WRITE|REMOVE|RENAME|CHMOD)
-h, --help display this message
-i, --ignore glob ignore pathname glob pattern
-p, --pattern glob trigger pathname glob pattern (default "**")
-r, --restart restart the command on exit
-s, --signal signal signal used to stop the command (default "SIGTERM")
-t, --target path observation target path (default "./")
-v, --verbose verbose output
-V, --version display version
Monitor file modifications under the path
directory.
The subdirectories are also monitored unless they match to the ignore patterns.
This option can be set multiple times.
The default value is the current directory ("./").
Note: This option can be file instead of directory, but arelo cannot follow modification after the file has been removed/renamed.
Restart command when the modified file is matched to this pattern.
The pattern is specified as an extended glob
that supports {alt1,...}
, **
like zsh or bash with globstar option.
And note that the path delimiter is /
even on Windows.
This option can set multiple times.
The default value ("**") is a pattern that matches any file in the target directories and their subdirectories.
Ignore the file or directory whose names is matched to this pattern.
This option takes precedence over the --pattern option.
This option can set multiple times.
Filter the filesystem event to ignore it.
The event can be CREATE
, WRITE
, REMOVE
, RENAME
or CHMOD
.
This option can set multiple times.
Delay the restart of the command from the detection of the pattern matched file modification. The detections within the delay are ignored.
The duration is specified as a number with a unit suffix ("ns", "us" (or "µs"), "ms", "s", "m", "h").
This signal will be sent to stop the command on restart.
The default signal is SIGTERM
.
This option can be SIGHUP
, SIGINT
, SIGQUIT
, SIGKILL
, SIGUSR1
, SIGUSR2
, SIGWINCH
or SIGTERM
.
This option is not available on Windows.
Automatically restart the command when it exits, similar to when the pattern matched file is modified.
Output logs verbosely.
Print version informatin.
Print usage.
arelo -t ./src -t ./html -p '**/*.{go,html,yaml}' -i '**/.*' -- go run .
Monitor files under the ./src or ./html directories.
Restart command when any *.go, *.html, *.yml file under the target, sub, and subsub... directories modified.
Ignore files/directories whose name starts with '.'.
Command to run.