LinuxCommandLibrary

laravel-zero

Create console applications using the Laravel framework

TLDR

Create a new Laravel Zero application

$ laravel-zero new [name]
copy

Update the installer to the latest version
$ laravel-zero self-update
copy

List the available installer commands
$ laravel-zero list
copy

SYNOPSIS

laravel-zero new [options] name

PARAMETERS

new
    Scaffold a new Laravel Zero console application with given name

--dev
    Also install development dependencies (e.g., testing tools)

--ci
    Generate GitHub Actions CI workflow for testing

--full
    Allocate a complete Laravel application instead of minimal

--api
    Allocate a full Laravel API application

--stub[=STUB]
    Custom stub path to use for scaffolding

--date[=DATE]
    Specific date to inject into stubs

--force
    Overwrite existing application directory

-h, --help
    Display help message

-q, --quiet
    Suppress all output

-V, --version
    Show application version

--verbose
    Increase output verbosity (levels 1-3)

DESCRIPTION

Laravel Zero is a micro-framework designed for building console applications using components from the Laravel ecosystem. It provides a zero-configuration way to scaffold robust CLI tools with Artisan commands, service providers, configuration files, and dependency injection.

Install globally via Composer with composer global require laravel-zero/framework, then use laravel-zero new myapp to generate a new project. The resulting skeleton includes essential directories like app/Console/Commands, config/, and supports testing with PHPUnit. Customize with stubs, add CI workflows, or extend to full Laravel apps.

Ideal for automation scripts, deployers, or any terminal-based tools. Leverages Symfony Console under the hood for argument parsing and output formatting. Supports PHP 8.1+, Composer 2.x, and integrates seamlessly with Laravel's ecosystem for tasks like caching, queues, and HTTP clients in CLI context. (187 words)

CAVEATS

Requires PHP 8.1+, Composer 2.x. Global install via composer global require laravel-zero/framework needed. Ensure ~/.composer/vendor/bin in PATH. Minimal apps lack web server; extend for HTTP needs.

INSTALLATION

composer global require laravel-zero/framework
composer global update
Add ~/.composer/vendor/bin to $PATH

PROJECT STRUCTURE

Key dirs: app/Console/Commands for custom commands, config/ for settings, tests/ for PHPUnit, bootstrap/app.php for app bootstrap.

HISTORY

Created by Nuno Maduro in August 2020 to simplify Laravel CLI apps. Reached v1.0 in 2021, v2.0 with PHP 8.2 support in 2024. Actively maintained under laravel-zero org on GitHub.

SEE ALSO

composer(1), php(1), artisan(8)

Copied to clipboard