Windows swoole-cli Monitor

Change the file to automatically restart the service.


  1. install NodeJS.
  2. download and unzip.
  3. npm i -g windows-swoole-cli-monitor


The directory where swoole-cli.exe is located should be placed in the system environment variable.

cd swoole-project
windows-swoole ./index.php -w ./app/**/*.php -w ./view/**/*.php

Edit swoole-project/index.php


$http = new Swoole\Http\Server('', 9501);

$http->on('Request', function ($request, $response) {
    $response->header('Content-Type', 'text/html; charset=utf-8');
    $response->end('<h1>Hello Swoole. #' . rand(1000, 9999) . '</h1>');


Command line options

--cli-path or -c: swoole-cli.exe path, default swool-cli.exe.

--watch-path or -w: watch file path, supports multiple.


View Github