Commands you already know
Signatures, arguments, options, prompts and output helpers — identical to Artisan. If you can write a Laravel command, you are done learning.
A micro-framework for the terminal
Laravel Zero takes the parts of Laravel that make development delightful — the container, the console kernel, the ecosystem — and leaves the web behind. What's left is a framework that fits entirely in your head.
composer create-project laravel-zero/laravel-zero my-cli
➜ php my-cli inspire --author
Simplicity is the ultimate
sophistication.
— Leonardo da Vinci
➜ _
Every feature here exists because a command-line application needs it. Nothing was carried over out of habit.
Signatures, arguments, options, prompts and output helpers — identical to Artisan. If you can write a Laravel command, you are done learning.
One build command compiles your application, its vendor tree and its config into a standalone PHAR your users can simply run.
Register cron expressions directly on the command. Run the scheduler from a single crontab entry and forget about it.
Termwind renders your terminal UI with familiar utility classes. Tables, tasks, spinners and progress bars ship out of the box.
Pest is installed and configured. Assert on exit codes, expected questions and every line of rendered output.
Databases, filesystems, queues and logging are one install command away — and completely absent until you ask.
The anatomy of a command
Dependencies are resolved out of the container, exactly as they are in a Laravel controller. There is no new mental model to adopt — only a smaller one.
make:command.
<?php namespace App\Commands; use LaravelZero\Framework\Commands\Command; final class ReportCommand extends Command { protected $signature = 'report {--format=table}'; public function handle(Metrics $metrics): int { $this->table( ['Metric', 'Today', 'Change'], $metrics->summary(), ); return self::SUCCESS; } public function schedule(Schedule $schedule): void { $schedule->command(static::class)->dailyAt('09:00'); } }
composer create-project laravel-zero/laravel-zero my-cli
A working application with a sensible structure, a first command and a test suite.
php my-cli app:rename
Choose the binary name your users will type. Namespaces and the entry point follow along.
php my-cli app:build
A compiled, single-file executable lands in builds/, ready to publish anywhere.
“We replaced a pile of shell scripts with one Laravel Zero binary. Onboarding a new engineer went from an afternoon to a single download.”
Open source, MIT licensed and maintained in the open. Contributions and stars are always welcome.