CLI Commands
Overview
Nexphant includes a comprehensive CLI for development, deployment, and runtime management.
php nexphant [command] [options]Application
serve
Start development server with hot reload.
php nexphant serve
php nexphant serve --port=8080
php nexphant serve --host=0.0.0.0about
Display framework version and environment info.
php nexphant aboutRuntime Management
runtime:status
Show runtime status and worker information.
php nexphant runtime:statusruntime:health
Check runtime health metrics.
php nexphant runtime:healthruntime:metrics
Display runtime performance metrics.
php nexphant runtime:metricsruntime:doctor
Diagnose potential runtime issues.
php nexphant runtime:doctorruntime:backends
List available event loop backends.
php nexphant runtime:backendsruntime:workers
Manage worker processes.
php nexphant runtime:workersruntime:reload
Gracefully reload workers.
php nexphant runtime:reloadruntime:stop
Stop all workers gracefully.
php nexphant runtime:stopDatabase
migrate
Run pending migrations.
php nexphant migrate
php nexphant migrate --force
php nexphant migrate --step=1migrate:status
Show migration status.
php nexphant migrate:statusmigrate:rollback
Rollback last migration batch.
php nexphant migrate:rollback
php nexphant migrate:rollback --step=1migrate:refresh
Rollback all migrations and re-run.
php nexphant migrate:refreshmigrate:fresh
Drop all tables and re-run migrations.
php nexphant migrate:freshmigrate:diff
Generate migration from model changes.
php nexphant migrate:diffseed
Run database seeders.
php nexphant seed
php nexphant seed --class=UserSeederQueue
queue:work
Start queue worker.
php nexphant queue:work
php nexphant queue:work --queue=emails
php nexphant queue:work --timeout=60queue:stats
Show queue statistics.
php nexphant queue:statsqueue:retry
Retry failed jobs.
php nexphant queue:retry
php nexphant queue:retry --id=123queue:clear
Clear queue.
php nexphant queue:clear
php nexphant queue:clear --queue=emailsCode Generation
make:controller
Generate controller class.
php nexphant make:controller UserController
php nexphant make:controller Api/UserControllermake:model
Generate model class.
php nexphant make:model User
php nexphant make:model User --migrationmake:middleware
Generate middleware class.
php nexphant make:middleware AuthMiddlewaremake:migration
Generate migration file.
php nexphant make:migration create_users_tablemake:seeder
Generate seeder class.
php nexphant make:seeder UserSeedermake:job
Generate job class.
php nexphant make:job SendEmailJobmake:event
Generate event class.
php nexphant make:event UserRegisteredmake:listener
Generate event listener.
php nexphant make:listener SendWelcomeEmailmake:data
Generate data transfer object.
php nexphant make:data UserDatamake:service
Generate service class.
php nexphant make:service UserServicemake:form
Generate form class.
php nexphant make:form UserFormmake:api
Generate API resource.
php nexphant make:api UserResourcemake:crud
Generate complete CRUD.
php nexphant make:crud UserRouting
route:list
List all registered routes.
php nexphant route:list
php nexphant route:list --method=GET
php nexphant route:list --path=/apiCache
cache:clear
Clear application cache.
php nexphant cache:clearconfig:clear
Clear configuration cache.
php nexphant config:clearoptimize
Optimize framework for production.
php nexphant optimizeoptimize:clear
Clear optimization cache.
php nexphant optimize:clearpreload
Generate preload file.
php nexphant preloadDevelopment
route:list
List all routes with middleware.
php nexphant route:listExamples
Development Workflow
# Start dev server with hot reload
php nexphant serve
# Generate resources
php nexphant make:model Post --migration
php nexphant make:controller PostController
# Run migrations
php nexphant migrate
# Check routes
php nexphant route:listProduction Deployment
# Optimize
php nexphant optimize
# Run migrations
php nexphant migrate --force
# Check runtime health
php nexphant runtime:doctor
# Start workers
php app.phpQueue Management
# Start queue worker
php nexphant queue:work
# Monitor stats
php nexphant queue:stats
# Retry failed jobs
php nexphant queue:retry