Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Climate Laravel Package

league/climate

League CLImate makes PHP CLI output nicer with easy colored text, formatting, and styled messages. Install via Composer and use simple methods like red() or blue() to print readable, attention-grabbing console output for scripts and command-line tools.

View on GitHub
Deep Wiki
Context7

PHP's best friend for the terminal.

Frequently asked questions about Climate
How do I install league/climate in a Laravel project?
Run `composer require league/climate` in your project root. No Laravel-specific setup is needed—just require the autoloader and instantiate the `CLImate` class. Works standalone or with Laravel’s service container.
Can I use CLImate in Laravel Artisan commands?
Yes. Inject the `CLImate` instance into your `Command` class constructor via Laravel’s service container. Replace `echo` with methods like `$climate->info()` or `$climate->table()` for consistent, styled output.
Does league/climate support Windows terminals?
Yes, starting with version 3.1.1. CLImate automatically handles ANSI escape sequences for Windows, including password masking and colored output. Tested on Windows 10/11 and modern terminals.
How do I add progress bars to Laravel migrations?
Use `$climate->progress()->start('Migrating...')` before your migration loop, then call `$climate->progress()->advance()` for each step. Finish with `$climate->progress()->finish()`. Works seamlessly with Laravel’s migration system.
Is league/climate compatible with Laravel 10+ and PHP 8.2+?
Yes. CLImate supports PHP 8.1–8.4 and Laravel 9/10. Check the [release notes](https://github.com/thephpleague/climate/releases) for version-specific features. The latest stable version (3.x) is fully backward-compatible.
Can I customize CLImate’s colors for my Laravel app’s branding?
Absolutely. Extend the default palette using `CLImate::extend()` or override colors in your `CLImate` instance. Example: `$climate->setOption('colors', ['primary' => '#3b82f6'])` for Tailwind-like themes.
How do I test terminal output in PHPUnit?
Use a hybrid approach: unit test logic (e.g., method calls) and integration tests for visual output. Mock `$climate->output` for unit tests, or capture STDOUT with `expectOutputString()` in PHPUnit for integration tests.
Does CLImate work with Laravel’s queue workers?
Yes. Use spinners or progress bars to show real-time job status. Example: `$climate->spinner()->start('Processing job...'); $job->handle(); $climate->spinner()->finish()`. Ideal for long-running queue jobs.
What’s the difference between CLImate and Symfony’s Console component?
CLImate is lighter and focused on output styling (colors, tables, progress bars), while Symfony’s Console offers advanced features like multi-step forms and complex prompts. Use CLImate for simple CLI tools and Symfony for interactive workflows.
How do I handle CLImate errors in Laravel’s logging system?
Integrate CLImate with Laravel’s `Log` facade by setting a PSR-3 logger. Example: `$climate->setLogger(app(Log::class))`. Exceptions (e.g., `InvalidArgumentException`) will then log via Laravel’s default channels.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai