Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Smenu | 2,272 | 4 days ago | 4 | mpl-2.0 | C | |||||
smenu started as a lightweight and flexible terminal menu generator, but quickly evolved into a powerful and versatile CLI selection tool for interactive or scripting use. | ||||||||||
Tty Prompt | 1,396 | 500 | 387 | 16 days ago | 33 | April 17, 2021 | 19 | mit | Ruby | |
A beautiful and powerful interactive command line prompt | ||||||||||
Suitcase | 1,201 | 3 years ago | 6 | |||||||
A flexible command line tool for instantly deploying user interfaces for simple commands and scripts. | ||||||||||
Laravel Console Menu | 789 | 48 | 27 | 9 months ago | 13 | January 13, 2022 | 5 | mit | PHP | |
🔘 Beautiful PHP CLI menus. Is a php-school/cli-menu wrapper for Laravel/Artisan Console Commands | ||||||||||
Easyconsole | 147 | 5 | 1 | 4 years ago | 2 | May 09, 2016 | 8 | mit | C# | |
EasyConsole is a library to make it easier for developers to build a simple menu interface for a .NET console application. | ||||||||||
Pywincontext | 83 | 4 years ago | 5 | gpl-3.0 | Python | |||||
Manager for Custom Context Menus in Windows 7 and higher | ||||||||||
Xdgmenumaker | 49 | 4 months ago | 6 | gpl-3.0 | Python | |||||
A command line tool that generates XDG menus for several window managers | ||||||||||
Qprompt | 44 | 7 | 4 | 2 years ago | 52 | November 20, 2021 | 2 | mit | Python | |
Python library for quick CLI user prompts, input, and menus. | ||||||||||
Vbar | 41 | 3 years ago | 5 | mit | Go | |||||
A bar | ||||||||||
Console | 38 | a month ago | apache-2.0 | Go | ||||||
Closed-loop application library for Cobra commands (powerful, ready-to-run and easy to use) |
Laravel Console Menu was created by, and is maintained by Nuno Maduro, and is a php-school/cli-menu wrapper for Laravel Console Commands.
Requires PHP 8.1+
Require Laravel Console Menu using Composer:
composer require nunomaduro/laravel-console-menu
class MenuCommand extends Command
{
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$option = $this->menu('Pizza menu', [
'Freshly baked muffins',
'Freshly baked croissants',
'Turnovers, crumb cake, cinnamon buns, scones',
])->open();
$this->info("You have chosen the option number #$option");
}
}
class MenuCommand extends Command
{
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$option = $this->menu('Pizza menu')
->addOption('mozzarella', 'Mozzarella')
->addOption('chicken_parm', 'Chicken Parm')
->addOption('sausage', 'Sausage')
->addQuestion('Make your own', 'Describe your pizza...')
->addOption('burger', 'Prefer burgers')
->setWidth(80)
->open();
$this->info("You have chosen the text option: $option");
}
}
class MenuCommand extends Command
{
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$menu = $this->menu('Pizza menu')
->addOption('mozzarella', 'Mozzarella')
->addOption('chicken_parm', 'Chicken Parm')
->addOption('sausage', 'Sausage')
->addQuestion('Make your own', 'Describe your pizza...');
$itemCallable = function (CliMenu $cliMenu) use ($menu) {
$cliMenu->askPassword()
->setValidator(function ($password) {
return $password === 'secret';
})
->setPromptText('Secret password?')
->ask();
$menu->setResult('Free spice!');
$cliMenu->close();
};
$menu->addItem('Add extra spice for free (password needed)', $itemCallable);
$option = $menu->addOption('burger', 'Prefer burgers')
->setWidth(80)
->open();
$this->info("You have chosen the text option: $option");
}
}
Available colors: black
, red
, green
, yellow
, blue
, magenta
, cyan
, white
.
$this->menu($title, $options)
->setForegroundColour('green')
->setBackgroundColour('black')
->setWidth(200)
->setPadding(10)
->setMargin(5)
->setExitButtonText("Abort") // remove exit button with ->disableDefaultItems()
->setTitleSeparator('*-')
->addLineBreak('<3', 2)
->addStaticItem('AREA 2')
->open();
Check out the full documentation here.
Thank you for considering to contribute to Laravel Console Menu. All the contribution guidelines are mentioned here.
You can have a look at the CHANGELOG for constant updates & detailed information about the changes. You can also follow the twitter account for latest announcements or just come say hi!: @enunomaduro
Do you like this project? Support it by donating
Laravel Console Menu is an open-sourced software licensed under the MIT license.