Skip to content

🚧 Under Construction 🚧

This site is currently under construction. This page is generated by AI and has not undergone thorough review by a human. There may be hallucination!

In fact, for now only /, /reactive, and the llms.txt are carefully crafted by myself.

Quick Start

Let's create a minimal example that shows HMR rerunning a dependent module without restarting the process.

1. Create two files

Create greet.py:

def message():
    return "Hello, World!"

Create main.py:

from greet import message

print(message())

2. Run with HMR

hmr main.py

You should see:

Hello, World!

3. Edit the dependency and watch it reload

Without stopping hmr, change greet.py:

def message():
    return "HMR is working!"

Save the file. HMR reloads greet.py, notices that main.py depends on it, and reruns main.py:

Hello, World!
HMR is working!

The process stays alive waiting for more changes; press Ctrl+C when you want to stop it.

Framework Examples

FastAPI/ASGI apps:

pip install uvicorn-hmr
uvicorn-hmr main:app

Flask apps:

hmr start.py  # where start.py creates and runs your Flask app

MCP servers:

pip install mcp-hmr
mcp-hmr main:app

Next Steps

For long-running servers and dev workflows, prefer the dedicated wrappers like uvicorn-hmr, mcp-hmr, or hmr-daemon.