Skip to content

CLI Commands ​

Overview ​

Nexphant includes a comprehensive CLI for development, deployment, and runtime management.

bash
php nexphant [command] [options]

Application ​

serve ​

Start development server with hot reload.

bash
php nexphant serve
php nexphant serve --port=8080
php nexphant serve --host=0.0.0.0

about ​

Display framework version and environment info.

bash
php nexphant about

Runtime Management ​

runtime:status ​

Show runtime status and worker information.

bash
php nexphant runtime:status

runtime:health ​

Check runtime health metrics.

bash
php nexphant runtime:health

runtime:metrics ​

Display runtime performance metrics.

bash
php nexphant runtime:metrics

runtime:doctor ​

Diagnose potential runtime issues.

bash
php nexphant runtime:doctor

runtime:backends ​

List available event loop backends.

bash
php nexphant runtime:backends

runtime:workers ​

Manage worker processes.

bash
php nexphant runtime:workers

runtime:reload ​

Gracefully reload workers.

bash
php nexphant runtime:reload

runtime:stop ​

Stop all workers gracefully.

bash
php nexphant runtime:stop

Database ​

migrate ​

Run pending migrations.

bash
php nexphant migrate
php nexphant migrate --force
php nexphant migrate --step=1

migrate:status ​

Show migration status.

bash
php nexphant migrate:status

migrate:rollback ​

Rollback last migration batch.

bash
php nexphant migrate:rollback
php nexphant migrate:rollback --step=1

migrate:refresh ​

Rollback all migrations and re-run.

bash
php nexphant migrate:refresh

migrate:fresh ​

Drop all tables and re-run migrations.

bash
php nexphant migrate:fresh

migrate:diff ​

Generate migration from model changes.

bash
php nexphant migrate:diff

seed ​

Run database seeders.

bash
php nexphant seed
php nexphant seed --class=UserSeeder

Queue ​

queue:work ​

Start queue worker.

bash
php nexphant queue:work
php nexphant queue:work --queue=emails
php nexphant queue:work --timeout=60

queue:stats ​

Show queue statistics.

bash
php nexphant queue:stats

queue:retry ​

Retry failed jobs.

bash
php nexphant queue:retry
php nexphant queue:retry --id=123

queue:clear ​

Clear queue.

bash
php nexphant queue:clear
php nexphant queue:clear --queue=emails

Code Generation ​

make:controller ​

Generate controller class.

bash
php nexphant make:controller UserController
php nexphant make:controller Api/UserController

make:model ​

Generate model class.

bash
php nexphant make:model User
php nexphant make:model User --migration

make:middleware ​

Generate middleware class.

bash
php nexphant make:middleware AuthMiddleware

make:migration ​

Generate migration file.

bash
php nexphant make:migration create_users_table

make:seeder ​

Generate seeder class.

bash
php nexphant make:seeder UserSeeder

make:job ​

Generate job class.

bash
php nexphant make:job SendEmailJob

make:event ​

Generate event class.

bash
php nexphant make:event UserRegistered

make:listener ​

Generate event listener.

bash
php nexphant make:listener SendWelcomeEmail

make:data ​

Generate data transfer object.

bash
php nexphant make:data UserData

make:service ​

Generate service class.

bash
php nexphant make:service UserService

make:form ​

Generate form class.

bash
php nexphant make:form UserForm

make:api ​

Generate API resource.

bash
php nexphant make:api UserResource

make:crud ​

Generate complete CRUD.

bash
php nexphant make:crud User

Routing ​

route:list ​

List all registered routes.

bash
php nexphant route:list
php nexphant route:list --method=GET
php nexphant route:list --path=/api

Cache ​

cache:clear ​

Clear application cache.

bash
php nexphant cache:clear

config:clear ​

Clear configuration cache.

bash
php nexphant config:clear

optimize ​

Optimize framework for production.

bash
php nexphant optimize

optimize:clear ​

Clear optimization cache.

bash
php nexphant optimize:clear

preload ​

Generate preload file.

bash
php nexphant preload

Development ​

route:list ​

List all routes with middleware.

bash
php nexphant route:list

Examples ​

Development Workflow ​

bash
# 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:list

Production Deployment ​

bash
# Optimize
php nexphant optimize

# Run migrations
php nexphant migrate --force

# Check runtime health
php nexphant runtime:doctor

# Start workers
php app.php

Queue Management ​

bash
# Start queue worker
php nexphant queue:work

# Monitor stats
php nexphant queue:stats

# Retry failed jobs
php nexphant queue:retry

Next Steps ​

Released under the MIT License.