Skip to content

Basic Usage

Learn the fundamentals of using Pyreload to monitor and restart your Python applications.

Running Pyreload

The basic syntax is:

pyreload [OPTIONS] SCRIPT [-- SCRIPT_ARGS]

Common Patterns

Watch Current Directory

pyreload app.py

Watch Specific Directories

pyreload -w src -w config app.py

Custom Extensions

pyreload -e py -e yaml -e json app.py

Interactive Commands

While Pyreload is running, you can use these commands:

  • r - Manual restart
  • q - Quit Pyreload
  • h - Show help

Configuration File

Instead of command-line options, you can use a config file:

# pyreload.yml
watch:
  - src
  - config
extensions:
  - py
  - yaml
ignore:
  - "**/__pycache__/**"
  - "**/.git/**"

Then run:

pyreload -c pyreload.yml app.py

Environment Variables

Pyreload passes all environment variables to your script:

DEBUG=true PORT=8000 pyreload app.py

Next Steps