watchexec(1) General Commands Manual watchexec(1) (NAME) watchexec - (SYNOPSIS) watchexec [--bell] [-c|--clear] [--completions] [--color] [-d|--debounce] [--delay-run] [-e|--exts] [-E|--env] [--emit-events-to] [-f|--filter] [--socket] [--filter-file] [-j|--filter-prog] [--fs-events] [-i|--ignore] [-I|--interactive] [--exit-on-error] [--ignore-file] [--ignore-nothing] [--log-file] [--manual] [--map-signal] [-n ] [-N|--notify] [--no-default-ignore] [--no-discover-ignore] [--no-process-group] [--no-global-ignore] [--no-meta] [--no-project-ignore] [--no-vcs-ignore] [-o|--on-busy-update] [--only-emit-events] [--poll] [--print-events] [--project-origin] [-p|--postpone] [-q|--quiet] [-Q|--quote] [-r|--restart] [-s|--signal] [--shell] [--stdin-quit] [--stop-signal] [--stop-timeout] [--timeout] [--timings] [-v|--verbose]... [-w|--watch] [--workdir] [-W|--watch-non-recursive] [--wrap-process] [-F|--watch-file] [--no-follow-symlinks] [-h|--help] [-V|--version] [COMMAND] (DESCRIPTION) . ( ) . watchexec () . watchexec . (debounce) (FILTERING) . : ( SIGINT/SIGTERM ) (`---events`) `-w` (`--ignore` ) ( `--\xts`) . : : $ watchexec make HTML CSS JavaScript : $ watchexec -e html,css,js make : $ watchexec -c make test node.js: $ watchexec -r node app.js lib src : $ watchexec -w lib -w src make (OPTIONS) --ompletions . Watchexec . : bash, elvish, fish, nu, powershell, zsh. --nual 'man' Watchexec . ROFF ( watchexec.1) stdout . --ets stdout . Watchexec . `cat` . `--\mit-events-to=json-stdio` `--\mit-events-to=stdio` . -h, -- ( '-h') -V, -- [COMMAND] ( ) debounce ( '--ostpone' ). --- . : $ watchexec -w src npm run build $ watchexec -w src --- rsync -a src dest glob . Watchexec . : $ watchexec echo src/*.rs $ watchexec echo 'src/*.rs' $ watchexec --ell=none echo 'src/*.rs' '--ell' : 'none' '--ell' . 'none' execvp(3) : ( 'PATH') . (COMMAND) --elay-run Watchexec (sleep) . "sleep 5 && command" . "2min 5s" . . -E, --\nv Watchexec . key=value . . --cket systemd `systemfd` : watchexec . . . `PORT` ( TCP ) `HOST:PORT` ( IP IPv6 `[]` ) `TYPE::PORT` `TYPE::HOST:PORT` ( `tcp` / `udp`) . `systemfd` . `systemfd` watchexec systemfd systemd . Watchexec `LISTEN_PID` `LISTEN_*` . -n '--ell=none' --0-process-group Watchexec (process group) . . '--96ocess=none' . -Q, --quote . (false) CMD PowerShell . git-bash nushell . macOS (true) . . /macOS git-bash true . Nushell . --ell Watchexec '$SHELL' 'sh' 'pwsh' 'powershell' 'cmd' (CMD.EXE) Watchexec . . . '-c' ( 'cmd' '/C' ). 'none' . Watchexec . . 'none' globbing (pipes) . : : $ watchexec -n --- zsh -x -o shwordsplit scr powershell core: $ watchexec --ell=pwsh --- Test-Connection localhost CMD.exe: $ watchexec --ell=cmd --- dir : $ watchexec --ell=bash --- 'echo $BASH_VERSION' : $ watchexec --ell='zsh -x -o shwordsplit' --- scr --op-signal 'restart' 'signal' '--gal' ). restart ( '--imeout-stop' ) . "SIGTERM" . ( "SIGTERM") ( "TERM") ( "15") . . "KILL" Watchexec . ( "KILL" "STOP" ) "CTRL+C" "CTRL+BREAK" "CTRL+CLOSE" . "SIGKILL" "SIGINT" "SIGTERM" "SIGHUP" . --op-timeout 'restart' '-- "5min 20s" . . . . '--op-signal' . --imeout "30s" "5min" "1h 30m" . --op-signal --op-timeout . . --408 Watchexec . . . --96ocess [: group] Watchexec (session) (Job Object) . . 'group' 'session' 'none' . 'group' 'session' Job Object . . * * . ! (EVENTS) -d, --ebounce Watchexec ( ) . Watchexec . . ( "30min" ) . . "5sec 20ms" . . . . --\mit-events-to Watchexec . . `RENAMED` . . . "" ( ) "" ( ) debounce . . 'none' . 'environment' ( ) 'stdio' 'file' 'json-stdio' 'json-file'. 'stdio' 'file' : 'stdio' (stdin) ( `create:` `remove:` `rename:` `modify:` `other:`) 'file' $WATCHEXEC_EVENTS_FILE . JSON JSON Watchexec . : { "tags": [ { "kind": "path", "absolute": "/home/user/your/new-folder", "filetype": "dir" }, { "kind": "fs", "simple": "create", "full": "Create(Folder)" }, { "kind": "source", "source": "filesystem", } ], "metadata": { "notify-backend": "inotify" } } : - `tags` . - `tags[].kind` : * 'path' : + `absolute` . + `filetype` ('dir', 'file', 'symlink', 'other'). * 'fs': + `simple` "" ('access', 'create', 'modify', 'remove', 'other'). + `full` "" 'General(Precise(Specific))' . * 'source' : + `source` ('filesystem', 'keyboard', 'mouse', 'os', 'time', 'internal'). * 'keyboard' : + `keycode`. 'eof' . * 'process' : + `pid` (PID). * 'signal' Watchexec: + `signal` ('hangup', 'interrupt', 'quit', 'terminate', 'user1', 'user2'). * 'completion' : + `disposition` ('success', 'error', 'signal', 'stop', 'exception', 'continued'). + `code` . - `metadata` . 'json-stdio' JSON (stdin) ( ) stdin . 'json-file' $WATCHEXEC_EVENTS_FILE . 'environment' . . : $WATCHEXEC_COMMON_PATH / . : - $WATCHEXEC_CREATED_PATH / - $WATCHEXEC_REMOVED_PATH / - $WATCHEXEC_RENAMED_PATH / - $WATCHEXEC_WRITTEN_PATH / - $WATCHEXEC_META_CHANGED_PATH / - $WATCHEXEC_OTHERWISE_CHANGED_PATH : ';' ':' . ( /locale). . . . $WATCHEXEC_COMMON_PATH . -I, --interactive Watchexec . : 'r' 's' 'p' 'q' . (TTY) stdin (raw mode) stdin . --\xit-on-error Watchexec . . Watchexec . --p-signal "TERM:INT" SIGTERM SIGINT. watchexec . "TERM:" SIGTERM. SIGINT SIGTERM Watchexec . Watchexec Ctrl-C Watchexec ( "INT:INT"). . ( "TERM", "USR2") ( "SIGKILL", "SIGHUP") . ( "15", "31"). "STOP" "CTRL+C" "CTRL+BREAK" Watchexec STOP . -o, -- 'do-nothing' ( ) . 'queue' 'restart' . 'signal' . '--gnal' . --oll [] (polling) Watchexec . (polling) ( ) . "2s 500ms" . . . '--rce-poll' . -p, --ostpone Watchexec . . -r, --estart '-- -s, --gnal . '--gal' 'restart' '--op-signal' . '--op-signal' . 'kill' . "" '--op-signal' . --din-quit stdin stdin EOF Watchexec . . (FILTERING) -e, --\xts . ( 'js' '.js'). . -f, --lter glob . . ( ) . --lter-file ( ) . '#' . '--lter' . $WATCHEXEC_FILTER_FILES . -j, --lter-prog jaq ( jq) . '--\mit-events-to' . watchexec '-v' . jaq watchexec : - 'path | file_meta' null . - 'path | file_size' null . - 'path | file_read(bytes)' n . n . . - 'string | hash' 'path | file_hash' . : () . - 'any | kv_store(key)' 'kv_fetch(key)' 'kv_clear' - . (persistence) . . - 'any | printout' 'any | printerr' 'any | log(level)' stdout stderr ( = error, warn, info, debug, trace) ( '[1] | log("debug") | .[]' '1' '[1]' ). kv . watchexec . . '@' jaq . jaq (short-circuit) : ( jaq ) . 'any' 'all' ! . : : 'all(.tags[] | select(.kind == "path"); .absolute | test("[.]test[.]js$")) | not' : 'any(.tags[] | select(.kind == "fs"); .simple == "create")' : 'any(.tags[] | select(.kind == "path" && .filetype == "file"); .absolute | metadata | .executable)' shebang : 'any(.tags[] | select(.kind == "path" && .filetype == "file"); .absolute | read(2) == "#!") | not' ---events . 'access' 'create' 'remove' 'rename' 'modify' 'metadata' . . 'access' . () . -i, --ignore glob . . ( ) . --ignore-file ( ) . '#' . '--ignore' . $WATCHEXEC_IGNORE_FILES . --ignore-nothing '--0-discover-ignore' '--0-default-ignore' . '--ignore' '--ignore-file' . --0-default-ignore Watchexec (swap) `*.pyc`, `*.pyo`, `.DS_Store`, `.bzr`, `_darcs`, `.fossil-settings`, `.git`, `.hg`, `.pijul`, `.svn` Watchexec. --0-discover-ignore '--0-global-ignore', '--0-vcs-ignore', '--0-project-ignore' . '--0-default-ignore' . --0-global-ignore '~/.gitignore' '~/.config/watchexec/ignore' '%APPDATA%\Bazzar\2.0\ignore'. '--0-vcs-ignore' '--0-project-ignore'. : - Git ( core.excludesFile): - Git ( ): $XDG_CONFIG_HOME/git/ignore, %APPDATA%/.gitignore, %USERPROFILE%/.gitignore, $HOME/.config/git/ignore, $HOME/.gitignore. - Bazaar: %APPDATA%/Bazzar/2.0/ignore, $HOME/.bazaar/ignore. - Watchexec: $XDG_CONFIG_HOME/watchexec/ignore, %APPDATA%/watchexec/ignore, %USERPROFILE%/.watchexec/ignore, $HOME/.watchexec/ignore. Git Bazaar . --0-meta '---events create,remove,rename,modify' . '---events' . --0-project-ignore '.gitignore' '.ignore' . '--0-vcs-ignore' Git '--0-global-ignore' '~/.gitignore' '~/.config/watchexec/ignore' . : - Git: .gitignore .git/info/exclude `core.excludesFile` .git/config. - Mercurial: .hgignore . - Bazaar: .bzrignore . - Darcs: _darcs/prefs/boring - Fossil: .fossil-settings/ignore-glob - Ripgrep/Watchexec/generic: .ignore . ( Git Mercurial Bazaar Darcs Fossil) / . .bzrignore Git . --0-vcs-ignore (gitignores) (VCS) Mercurial Subversion Bazaar DARCS Fossil. Watchexec . ( '~/.gitignore') ( '.gitignore') . Git . --roject-origin Watchexec "" ( "") . . '/' . Watchexec . -w, --240 Watchexec . . . Watchexec " " . '--roject-origin' . . '/dev/null' Watchexec . ( ) . -W, --576 '-w' . . -F, --360 '-w' . ( ) argfile : `@path/to/argfile` watchexec . '-' STDIN '--din-quit' . --0-follow-symlinks Watchexec . . macOS . (DEBUGGING) -- JSON . '-vvv' . . '--ignore-nothing' Watchexec . . 'watchexec.YYYY-MM-DDTHH-MM-SSZ.log' . --rint-events ( debounce) . . '-vvv' . -v, -- "" . . '-vvvv' . '-vvv' . '-- $WATCHEXEC_LOG . $WATCHEXEC_LOG . (OUTPUT) -- -c, --lear [] '--lear=reset' . --olor [: auto] `NO_COLOR` `--olor=never` . -N, --0tify [] Watchexec . . (`start`) (`end`) (`both` - ) . -q, --quiet Watchexec . . --imings (overhead) Watchexec . `time` (benchmarking) . (EXTRA) @argfile 'argfile' ( ) @argfile ( ). '-h' . (VERSION) v2.7.2 (AUTHORS) Felix Saparelli , Matt Green watchexec 2.7.2 watchexec(1)