Skip to content

Pyreload CLI ๐Ÿ”„

Pyreload

Automatically restart Python applications when file changes are detected

PyPI version Python versions Coverage License

Python Watchdog Docker Vagrant Pytest Black

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 - .pyreloadrc or pyreload.json for 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 rs to restart, stop to exit

Quick Example

pip install pyreload-cli
pyreload app.py
pyreload app.py --polling
// .pyreloadrc
{
  "watch": ["*.py", "config/*.yaml"],
  "ignore": ["*__pycache__*"],
  "polling": true
}

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:

pyreload app.py -w "*.py" -w "config/*.yaml" -w "templates/*.html"

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

License

MIT License - see LICENSE for details.