01
Console kernel
The full Artisan command layer — signatures, arguments, options, prompts and output helpers, unchanged.
v12.0 — Laravel 12 · PHP 8.2+
Laravel Zero removes the HTTP layer, the routing, the sessions and the views. What remains is a fast, focused foundation for the command-line tools your team actually runs.
$ php my-cli migrate:audit
| Migration | Batch | Status |
|---|---|---|
| create_users | 1 | ran |
| add_indexes | 2 | ran |
| drop_legacy | - | pending |
3 migrations · 1 pending · 0.08s
Install
composer create-project laravel-zero/laravel-zero my-cli
01 — Overview
01
The full Artisan command layer — signatures, arguments, options, prompts and output helpers, unchanged.
02
Constructor and method injection everywhere, with the same binding and singleton APIs as Laravel.
03
Declare a schedule on the command itself and drive the entire application from one crontab entry.
04
app:build produces a single executable file containing your code, config and vendor tree.
05
Style terminal output with utility classes. Tables, tasks, spinners and progress bars included.
06
A configured test suite from the start, with helpers for exit codes, prompts and output assertions.
02 — Commands
Nothing is registered by hand. Drop a class into app/Commands
and it becomes part of your application's interface immediately.
| make:command | Scaffold a new command class |
|---|---|
| app:rename | Rename the compiled binary |
| app:build | Compile a standalone PHAR |
| app:install | Add an optional component |
<?php declare(strict_types=1); namespace App\Commands; use Illuminate\Console\Scheduling\Schedule; use LaravelZero\Framework\Commands\Command; final class AuditCommand extends Command { protected $signature = 'migrate:audit {--pending}'; protected $description = 'Audit database migrations'; public function handle(Auditor $auditor): int { $rows = $auditor->inspect( pendingOnly: (bool) $this->option('pending'), ); $this->table(['Migration', 'Batch', 'Status'], $rows); return self::SUCCESS; } public function schedule(Schedule $schedule): void { $schedule->command(static::class)->hourly(); } }
03 — Distribution
Step 1
php my-cli make:command Audit
Add commands until the tool does what your team needs. Test them as you go.
Step 2
php my-cli app:rename audit
Pick the binary name. The entry point and namespaces are rewritten for you.
Step 3
php my-cli app:build
A single executable file appears in builds/. Publish it however you like.
04 — Add-ons
php my-cli app:install <addon>
| Component | Provides | Status |
|---|---|---|
| database | Eloquent ORM, migrations, seeders | Optional |
| log | Monolog channels and handlers | Optional |
| filesystem | Flysystem disks, local and cloud | Optional |
| dotenv | Environment file loading | Optional |
| menu | Interactive, arrow-key menus | Optional |
| queue | Background job dispatching | Optional |
| http | The Laravel HTTP client | Optional |
| self-update | In-place upgrades for your users | Optional |
Get started
composer create-project laravel-zero/laravel-zero my-cli