Zero Laravel

A micro-framework for the terminal

The console framework
with taste.

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
MIT licensed PHP 8.2+ Laravel 12 components

php my-cli inspire --author

Simplicity is the ultimate

sophistication.

— Leonardo da Vinci

_

Laravel's comfort, at a fraction of the weight.

Every feature here exists because a command-line application needs it. Nothing was carried over out of habit.

01

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.

02

A single distributable file

One build command compiles your application, its vendor tree and its config into a standalone PHAR your users can simply run.

03

Scheduling included

Register cron expressions directly on the command. Run the scheduler from a single crontab entry and forget about it.

04

Output worth looking at

Termwind renders your terminal UI with familiar utility classes. Tables, tasks, spinners and progress bars ship out of the box.

05

Testing from minute one

Pest is installed and configured. Assert on exit codes, expected questions and every line of rendered output.

06

Add-ons, not assumptions

Databases, filesystems, queues and logging are one install command away — and completely absent until you ask.

The anatomy of a command

A class, a signature, a handle method.

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.

  • 01 Scaffold with make:command.
  • 02 Declare the signature your users will type.
  • 03 Type-hint whatever you need and let the container do the rest.
app/Commands/ReportCommand.php
<?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');
    }
}

From an empty folder to a shipped binary.

01

Create

composer create-project laravel-zero/laravel-zero my-cli

A working application with a sensible structure, a first command and a test suite.

02

Name it

php my-cli app:rename

Choose the binary name your users will type. Namespaces and the entry point follow along.

03

Build

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.”
Platform Engineering — Northwind

Start your CLI this afternoon.

Open source, MIT licensed and maintained in the open. Contributions and stars are always welcome.