zcuric / laravel-artisan-choose
Searchable Artisan command chooser inspired by just --choose.
Requires
- php: ^8.2
- illuminate/console: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- laravel/prompts: ^0.1.24|^0.2.0|^0.3.0|^0.4.0
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0|^11.0
- phpunit/phpunit: ^10.5|^11.5
README
php artisan choose adds a searchable command picker to Laravel, inspired by just --choose.
Instead of remembering every Artisan command name, you can open an interactive chooser, search by command name, alias, or description, inspect command details, and run the selected command immediately.
Screenshare.-.2026-05-05.12_05_47.PM.mp4
Features
- Search visible Artisan commands by name, alias, or description
- Browse the full command list by pressing
Enteron an empty search box - Generate interactive forms for command arguments and options
- Keep a raw arguments / options escape hatch for advanced cases
- Keep normal Artisan behavior after selection, including nested prompts and console output
Requirements
- PHP 8.2+
- Laravel 10, 11, 12, or 13
Installation
composer require zcuric/laravel-artisan-choose
Laravel package discovery registers the service provider automatically.
Usage
Start the chooser:
php artisan choose
Interactive flow:
- Press
Enteron an empty search box to browse all available commands. - Type to narrow the list by command name, alias, or description.
- Use the arrow keys to highlight a command.
- Press
Enterto select it. - Fill in the generated prompts for the selected command's arguments and options.
- Optionally enter extra raw Artisan arguments or options for advanced cases.
The generated forms currently handle the most reliable command-definition shapes automatically:
- required and optional arguments
- array arguments
- boolean flags
- negatable options
- required and optional value options
- array value options
For example, after the generated prompts you can still append raw input such as:
Taylor --yell
--force
--seed --database=testing
The chooser then executes the selected command through the current Artisan application. Commands with no custom arguments or options skip straight to the raw-input fallback prompt.
Examples
Choose demo:greet-style commands and answer generated prompts for required arguments and flags:
php artisan choose
Choose migrate and still use the raw fallback:
--force
Choose make:controller, answer the generated prompts, and optionally append raw input:
Admin/UserController --resource
Behavior
- Hidden Artisan commands are excluded from the chooser.
- The
choosecommand does not list itself. - Command aliases are searchable.
- Command descriptions are searchable.
choosegenerates prompts from the selected command's native Symfony input definition instead of prompting for Artisan's global flags.- Raw extra input is appended after the generated parameters, so it can handle edge cases or intentionally override prompted values.
Testing
composer lint
composer test
To apply Pint formatting locally:
composer format
CI
GitHub Actions runs:
composer validatecomposer lintcomposer test- compatibility test runs for Laravel 10, 11, 12, and 13
Packagist Sync
Prefer enabling the Packagist GitHub integration so releases sync automatically.
If you need the manual GitHub webhook instead, configure:
- Payload URL:
https://packagist.org/api/github?username=zcuric - Content Type:
application/json - Secret: your Packagist API token
- Events: push
License
MIT