CLI Reference¶
Complete reference for Pyreload command-line interface.
Synopsis¶
Arguments¶
SCRIPT¶
The Python script to run and monitor.
SCRIPT_ARGS¶
Arguments to pass to your script (after --):
Options¶
Watch Options¶
-w, --watch PATH¶
Add a path to watch for changes. Can be specified multiple times.
Default: Current directory (.)
-e, --extension EXT¶
File extensions to watch. Can be specified multiple times.
Default: py
-i, --ignore PATTERN¶
Patterns to ignore. Supports glob syntax.
Common ignores are applied by default (.git, __pycache__, etc.)
Polling Options¶
--polling¶
Use polling instead of native file system events.
Useful for:
- Network file systems
- Docker volumes
- Vagrant synced folders
- Systems with limited inotify watches
--poll-interval SECONDS¶
Polling interval in seconds (default: 1.0).
Behavior Options¶
--clean¶
Clear screen before each restart.
--delay SECONDS¶
Delay in seconds before restarting after changes (default: 1.0).
--exec¶
Use exec mode (replace process instead of spawning child).
⚠️ Warning: Exec mode disables file watching.
--no-interactive¶
Disable interactive keyboard commands.
Useful in CI/CD or non-interactive environments.
Output Options¶
-v, --verbose¶
Enable verbose output.
Shows: - Watched paths - Detected changes - Process lifecycle events
-q, --quiet¶
Suppress Pyreload output (only show application output).
--debug¶
Enable debug-level logging.
Configuration Options¶
-c, --config FILE¶
Path to configuration file.
Supports formats:
- YAML (.yml, .yaml)
- JSON (.json)
- TOML (.toml)
--no-config¶
Don't load any configuration file.
Information Options¶
-h, --help¶
Show help message and exit.
--version¶
Show version and exit.
Interactive Commands¶
While Pyreload is running, press:
r- Manually restartq- Quith- Show helpc- Clear screen
Exit Codes¶
- 0 - Normal exit
- 1 - General error
- 2 - Configuration error
- 130 - Interrupted (Ctrl+C)
Examples¶
Basic Usage¶
# Watch current directory
pyreload app.py
# Watch specific directories
pyreload -w src -w config app.py
# Watch multiple file types
pyreload -e py -e yaml app.py
With Configuration¶
# Use config file
pyreload -c .pyreload.yml app.py
# Override config options
pyreload -c config.yml -v -w extra app.py
Advanced¶
# Polling with custom interval
pyreload --polling --poll-interval 0.5 app.py
# Clean screen, verbose, with delay
pyreload --clean -v --delay 2 app.py
# Pass arguments to script
pyreload app.py -- --host 0.0.0.0 --port 8000
Production¶
# Non-interactive with quiet output
pyreload --no-interactive -q app.py
# Exec mode for containers
pyreload --exec app.py
Environment Variables¶
Pyreload respects these environment variables:
PYRELOAD_CONFIG¶
Default configuration file path:
PYTHONUNBUFFERED¶
Force unbuffered output (recommended):
NO_COLOR¶
Disable colored output: