クイックリファレンス

Watchexec コマンド・ファイル変更検知自動再実行早見表

ファイルの変更を検知して任意のコマンドを自動再実行する Watchexec の早見表:拡張子指定(-e)、再起動フラグ(-r)、画面クリア(-c)、除外パターン(-i)。

· 公開日

Installation

macOS via Homebrew

brew install watchexec

Via Cargo (Rust)

cargo install watchexec-cli

Precompiled binaries for Linux and Windows are available from the Watchexec GitHub Releases.

Getting Started

# Run npm test whenever .js or .jsx files change
watchexec --exts js,jsx -- npm test
# Watch specific directories lib/ and test/
watchexec -w lib -w test -- npm test

Options & Flags

Flags

Flag Description
-c, --clear Clear screen before executing command
-r, --restart Restart process if it is still running

Options

Option Description
-s, --signal SIGKILL Signal sent to terminate existing process
-d, --debounce MS Debounce interval in milliseconds
-e, --exts EXTS Comma-separated list of file extensions
-i, --ignore PATTERN Ignore file or directory patterns
-w, --watch PATH Watch specific files or directories

References

関連テーマ