CLI Reference
Composer Scripts
Defined in composer.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:
composer run setupDev Mode
Starts the application in development mode with active file watching and hot reloading:
composer run devServe
Starts the persistent runtime application in production mode:
composer run servenexphant CLI Tool
The nexphant CLI executable allows managing background queues, monitoring runtime metrics, and administering workers.
php nexphant <command> [options] [arguments]queue:work
Starts a background queue worker process.
php nexphant queue:work
php nexphant queue:work --queue=emails
php nexphant queue:work --sleep=3queue:stats
Displays statistics for job counts, active workers, throughput, and error dead-letter queues (DLQ).
php nexphant queue:statsqueue:clear
Clears all pending jobs from the queue.
php nexphant queue:clearqueue:retry
Retries failed jobs from the dead-letter queue.
php nexphant queue:retryruntime:status
Displays the current status of the persistent server process, active worker count, and system metrics.
php nexphant runtime:statusruntime:metrics
Displays detailed runtime statistics including uptime, total connection requests, active connections, and memory usage.
php nexphant runtime:metricsruntime:workers
Displays the status, active request counts, and execution lifecycles for all runtime child worker processes.
php nexphant runtime:workersruntime:health
Performs a quick diagnostic and prints the health status of the running server.
php nexphant runtime:healthruntime:reload
Triggers a zero-downtime graceful reload of all worker processes to apply changes.
php nexphant runtime:reloadruntime:stop
Gracefully terminates the runtime application and processes.
php nexphant runtime:stopruntime:doctor
Inspects system extensions and details support for asynchronous backends, Fibers, and APCu capabilities.
php nexphant runtime:doctorruntime:backends
Displays details about available and selected asynchronous event loop backends.
php nexphant runtime:backendsoptimize
Compiles hot path runtime classes to optimize execution speeds.
php nexphant optimize
php nexphant optimize --storage=storage/pathoptimize:clear
Clears any precompiled runtime optimization files.
php nexphant optimize:clearpreload
Preloads and warms runtime PHP classes to cache memory for OPcache or APCu.
php nexphant preload