argument('[name]', 'Your name') ->option('-g, --greet', 'Include a greeting message'); } public function execute(): int { $pb = $this->progress(100); for ($i = 0; $i < 100; $i += 10) { usleep(100000); // Simulate work $pb->advance(10); } $pb->finish(); $this->writer()->boldBlue("Demo Command Executed!\n"); if ($this->values()['name']) { $name = $this->values()['name']; $greet = $this->values()['greet'] ?? false; } else { return 0; } if ($greet) { $this->writer()->green("Hello, $name! Welcome to the CLI demo.\n"); } else { $this->writer()->yellow("Name provided: {$name}\n"); } return 0; } }