gevman / interactive-cli
PHP interactive CLI
Installs: 590
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/gevman/interactive-cli
Requires
- php: >=5.4
This package is auto-updated.
Last update: 2025-10-21 06:03:59 UTC
README
Installation (using composer)
composer require gevman/interactive-cli
Class Gevman\Cli\Cli
bool confirm(string $prompt [, bool $default = true])
Interactive confirm - returns user selected value (Y=true, N=false)
- $prompt- prompt message
- $default- default value
void input(&$input [, string $message = ''] [, bool $required = false])
Interactive prompt for user input
- $prompt- prompt message
- $default- default value
Gevman\Cli\CliOutput output(string $str [, mixed $_ = null])
Outputs message
- $str- message or pattern for sprintf
- $_- parameters for sprintf
Class Gevman\Cli\CliOutput
Gevman\Cli\CliOutput success()
Marks output green
Gevman\Cli\CliOutput warning()
Marks output Yellow
Gevman\Cli\CliOutput error()
Marks output Red
Gevman\Cli\CliOutput note()
Marks output Blue
Gevman\Cli\CliOutput endl()
Line break
Gevman\Cli\CliOutput cl()
Clear current line
void progressBar(mixed $all [, string $additionalInfo = ''])
Displays interactive progressbar (message should be current key)
- $all- count of all
- $additionalInfo- displays additional Info for each step
require '/path/to/autoload.php'; use Gevman\Cli\Cli; //basic example Cli::output('%s - %s', 'hello', 'world')->note()->endl()->output('yesimum')->error()->endl()->endl(); //pregressbar example $all = 100000; for ($step = 0; $step < 100000; $step++) { Cli::output($step + 1)->progressBar($all, $step); }