CLI Overview
The S-PHP framework includes a powerful command-line interface (CLI) tool calleddo that helps you quickly scaffold files, manage your development server, and handle database migrations.
Getting Started
The CLI tool is accessed through thedo script in your project root:
Available Commands
The CLI provides three categories of commands:Server Commands
up- Start the PHP built-in development serverwork- Run the job worker for background tasks
File Generators
controller [Name]- Generate a new controller classmiddleware [Name]- Generate a new middleware classmodel [Name]- Generate a new model classviews [path]- Generate a new view file
Database Commands
migrate- Run database migrationsmigration [Name]- Create a new migration file
Getting Help
Display the help menu with all available commands:Quick Examples
Command Structure
The CLI tool is implemented in two main files:do(Command.php:4) - Entry point script that processes command-line argumentsCommand.php(Command.php:9) - Main CLI handler class that executes commands
command-typeis one of the available commands listed abovename-or-pathis the identifier for the resource being created (not required for server commands)