Pyreload CLI ๐¶
Automatically restart Python applications when file changes are detected
Pyreload is a modern, easy-to-use file monitoring tool that automatically restarts your Python applications when code changes are detected. Perfect for development workflows with full support for Docker, Vagrant, and mounted filesystems via polling mode.
Features¶
- ๐ Zero-config reloading - Works with Python files by default
- ๐ Polling mode - Solves mounted filesystem limitations (Docker, Vagrant, CIFS/NFS)
- ๐ฏ Flexible patterns - Watch and ignore patterns with glob support
- โ๏ธ Config file support -
.pyreloadrcorpyreload.jsonfor team settings - ๐งน Clean mode - No logs, no prompts for production-like testing
- ๐ง Exec mode - Run any shell command, not just Python files
- โจ๏ธ Manual control - Type
rsto restart,stopto exit
Quick Example¶
Why Pyreload?¶
Polling Mode for Containers¶
Standard file watching relies on OS-level events (like inotify). These events don't propagate through mounted volumes. Pyreload's polling mode solves this by directly checking file modification times.
# Perfect for Docker development
docker run -v $(pwd):/app myapp pyreload app.py --polling
# Or Vagrant
vagrant ssh -c "cd /vagrant && pyreload app.py --polling"
Simple Configuration¶
Create a .pyreloadrc file to share settings with your team:
{
"watch": ["*.py", "config/*.yaml"],
"ignore": ["*__pycache__*", "*.log"],
"debug": false,
"polling": false
}
CLI arguments always override config file settings.
Multiple Watch Patterns¶
Watch different file types and directories:
Getting Started¶
Head over to the Installation Guide to begin, or jump straight to the Quick Start for a 2-minute setup.
Use Cases¶
Pyreload excels in these scenarios:
- Docker Development - Hot reload in containers with volume mounts
- Vagrant Workflows - Develop in VMs with synced folders
- Microservices - Restart services on code changes
- API Development - Auto-reload Flask/FastAPI apps
- Data Pipelines - Restart ETL scripts on changes
Comparison¶
| Feature | Pyreload | py-mon | nodemon |
|---|---|---|---|
| Python-native | โ | โ | โ |
| Polling mode | โ | โ | โ |
| Config file | โ | โ | โ |
| Docker/Vagrant | โ | โ ๏ธ Limited | โ |
| Zero config | โ | โ | โ |
Community¶
- GitHub: dotbrains/pyreload-cli
- PyPI: pypi.org/project/pyreload-cli
- Issues: Report bugs
License¶
MIT License - see LICENSE for details.