Skip to content

CLI Reference ​

Composer Scripts ​

Defined in composer.json:

json
{
  "scripts": {
    "setup": "php setup.php",
    "dev": "php nexphant.dev.php",
    "serve": "php app.php",
    "dump": "composer dump-autoload -o"
  }
}

Setup ​

Initializes the environment configuration:

bash
composer run setup

Dev Mode ​

Starts the application in development mode with active file watching and hot reloading:

bash
composer run dev

Serve ​

Starts the persistent runtime application in production mode:

bash
composer run serve

nexphant CLI Tool ​

The nexphant CLI executable allows managing background queues, monitoring runtime metrics, and administering workers.

bash
php nexphant <command> [options] [arguments]

queue:work ​

Starts a background queue worker process.

bash
php nexphant queue:work
php nexphant queue:work --queue=emails
php nexphant queue:work --sleep=3

queue:stats ​

Displays statistics for job counts, active workers, throughput, and error dead-letter queues (DLQ).

bash
php nexphant queue:stats

queue:clear ​

Clears all pending jobs from the queue.

bash
php nexphant queue:clear

queue:retry ​

Retries failed jobs from the dead-letter queue.

bash
php nexphant queue:retry

runtime:status ​

Displays the current status of the persistent server process, active worker count, and system metrics.

bash
php nexphant runtime:status

runtime:metrics ​

Displays detailed runtime statistics including uptime, total connection requests, active connections, and memory usage.

bash
php nexphant runtime:metrics

runtime:workers ​

Displays the status, active request counts, and execution lifecycles for all runtime child worker processes.

bash
php nexphant runtime:workers

runtime:health ​

Performs a quick diagnostic and prints the health status of the running server.

bash
php nexphant runtime:health

runtime:reload ​

Triggers a zero-downtime graceful reload of all worker processes to apply changes.

bash
php nexphant runtime:reload

runtime:stop ​

Gracefully terminates the runtime application and processes.

bash
php nexphant runtime:stop

runtime:doctor ​

Inspects system extensions and details support for asynchronous backends, Fibers, and APCu capabilities.

bash
php nexphant runtime:doctor

runtime:backends ​

Displays details about available and selected asynchronous event loop backends.

bash
php nexphant runtime:backends

optimize ​

Compiles hot path runtime classes to optimize execution speeds.

bash
php nexphant optimize
php nexphant optimize --storage=storage/path

optimize:clear ​

Clears any precompiled runtime optimization files.

bash
php nexphant optimize:clear

preload ​

Preloads and warms runtime PHP classes to cache memory for OPcache or APCu.

bash
php nexphant preload

Released under the MIT License.