uttamrabadiya/console-components

Lightweight PHP package designed to enhance the output of your CLI applications using Termwind & Laravel Prompts

1.0.3 2024-05-14 19:27 UTC

This package is auto-updated.

Last update: 2024-05-14 19:29:32 UTC


README

Console Components is a lightweight PHP package designed to enhance the output of your CLI applications. With Console Components, you can easily print beautiful and formatted output to the terminal using simple methods provided by the package. Say goodbye to dull and monotonous terminal output and give your applications a professional and polished look with Terminal Beautifier.

These components are extracted from Laravel's console package, that helps individual applications outside from Laravel environment.

Installation:

You can install Console Components via Composer:

composer require uttamrabadiya/console-components

Usage:

use ConsoleComponents\Writer;

Writer::info('Hello World! PHP is beautiful');

info.png

use ConsoleComponents\Writer;

Writer::warn('Please check message');

warn.png

use ConsoleComponents\Writer;

Writer::error('Something went wrong!');

error.png

use ConsoleComponents\Writer;

Writer::alert('Hello World!');

alert.png

use ConsoleComponents\Writer;

Writer::ask('What would you like to build today?');
Writer::ask('Something secret to ask', hidden: true); // Ask secretly

ask.png

use ConsoleComponents\Writer;

Writer::askWithCompletion('How are you today?', ['Good', 'Better', 'Ok Ok']);

ask-with-completion.png

use ConsoleComponents\Writer;

Writer::bulletList(['Item 1', 'Item 2', 'Item 3']);

bullet-list.png

use ConsoleComponents\Writer;

Writer::choice('What are you working on today?', ['Open source application', 'Building Profile', 'Inventing new feature']);

choice.png

use ConsoleComponents\Writer;

Writer::confirm('Are you sure you want to continue?');

confirm.png

use ConsoleComponents\Writer;

Writer::twoColumnDetail('PHP', 'Installing');
Writer::task('PHP');

task.png

use ConsoleComponents\Writer;

Writer::table(['Applications', 'Version'], [['PHP', '8.2'], ['NGINX', 1.2], ['MySQL', 8.0]]);

table.png

License

Console Components is open-sourced software licensed under the MIT license