📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials CodeIgniter 4 CI4 CLI Commands

CI4 CLI Commands

5 min read
Build interactive Spark commands with CLI arguments, options, progress bars, and colored output.

Custom CLI Commands

php spark make:command SendReport

class SendReport extends BaseCommand {
    protected $name = "report:send";
    protected $description = "Send daily reports";

    public function run(array $params): void {
        CLI::write("Sending reports...", "yellow");
        // do work
        CLI::write("Done!", "green");
    }
}