watcheagle - is hot reloader for your project based on watchdog!
Project description
watcheagle: A Simple File Watcher and Process Restarter (Fork of watchcat)
watcheagle is a lightweight command-line tool that monitors a directory for file changes and automatically restarts a specified process when a modification is detected. It's designed for development environments where you want to automatically reload your application on code changes. This project is based on the original watchcat but has been simplified and optimized for ease of use.
Goal
The primary goal of watcheagle is to provide a simple, reliable, and efficient way to automatically restart a process when files in a directory change. This is useful for rapid development cycles, automatically testing code, or automatically refreshing content on file updates.
Key Features
- Easy to Use: Simple command-line interface.
- Automatic Process Restart: Restarts your application whenever relevant files are modified.
- Fork of watchcat: Leaner and more straightforward, building upon the foundation of watchcat.
- Optional Source Directory: Specify the directory to watch, defaulting to the current directory.
Installation
pip install watcheagle
Usage
Invoke watcheagle from the command line, providing the command to execute and optionally the directory to watch.
watcheagle <command_to_execute> [--source <directory>]
Examples
-
Restarting a Python script in the current directory:
watcheagle python main.py
This command will execute
python main.pyand watch for changes in the current directory. Any file modification will trigger a restart of themain.pyscript. -
Restarting a Node.js application monitoring a specific directory:
watcheagle node app.js --source ./src
This command will execute
node app.jsand monitor the./srcdirectory. -
Using with a shell script:
watcheagle ./build_and_run.sh --source ./code
This command assumes you have a
build_and_run.shscript that builds your project and then runs it. It will watch the./codedirectory for changes. -
Monitoring current directory with react application
watcheagle yarn start --source ./
This is equivalent to running
yarn start, and the tool will restart yarn if a file is changed in the current directory
Optional Arguments
--source <directory>: Specify the directory to watch for changes. If not provided,watcheagledefaults to the current working directory.
.watchignore (Excluding Files and Directories - Original watchcat feature)
To exclude specific files or directories from being monitored, create a .watchignore file in the root directory being watched. Use fnmatch patterns. The changes may occur as implemented in watchcat original(exclude implementation).
Example .watchignore Usage
# Ignore the logs directory and its output
logs/
*.log
# Ignore temp files
temp_*
Contributing
Contributions are welcome! Feel free to fork the repository, make improvements, and submit pull requests.
License
This project is under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file watcheagle-1.0.2.tar.gz.
File metadata
- Download URL: watcheagle-1.0.2.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47a020daaf4e307c5490a2464b410fde51c1746ae0f3ce59f103928d341d13b6
|
|
| MD5 |
1d7f3d8f2502dce2ba7cdd94e5059a5a
|
|
| BLAKE2b-256 |
d09fcebf3be0c7f9650bdda8a9a5d0682ae4c227b42c4877a0306b065b9ec9bc
|
File details
Details for the file watcheagle-1.0.2-py3-none-any.whl.
File metadata
- Download URL: watcheagle-1.0.2-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae193841a1a24c4c9435abe943e316192c1a61efbfd9c90a4fff2ee1515e6d25
|
|
| MD5 |
edd594d0f5937148c482a8e50d1ec4e9
|
|
| BLAKE2b-256 |
2dc5d72d8b5fbfa5fc46524497c23c1a30442d6f5db73fb0c174f001a1305ffe
|