adhocore / php-cli
PHP Console Application made easy- build great console apps with ease. Comes with Zero Dependency and Autocompletion support.
adhocore/cli
Framework agnostic Command Line Interface utilities and helpers for PHP. Build Console App with ease, fun and love.
- Command line application made easy
- Inspired by nodejs commander (thanks tj)
- Zero dependency.
- For PHP7, PHP8 and for good
What's included
Core: Argv parser · Cli application · Shell
IO: Colorizer · Cursor manipulator · Stream writer · Stream reader
Other: Autocompletion
Installation
# PHP8.0 and above v1.0.0
composer require adhocore/cli:^v1.0.0
# PHP 7.x
composer require adhocore/cli:^v0.9.0
Usage
Argv parser
$command = new Ahc\Cli\Input\Command('rmdir', 'Remove dirs')
$command
->version('0.0.1-dev')
// Arguments are separated by space
// Format: `<name>` for required, `[name]` for optional
// `[name:default]` for default value, `[name...]` for variadic (last argument)
->arguments('<dir> [dirs...]')
// `-h --help`, `-V --version`, `-v --verbosity` options are already added by default.
// Format: `<name>` for
…Helps you build bespoke, interactive console app easy and quick - includes commands, actions, argument parsing, colors, cursors, interaction and all that is required.
inspired by nodejs commander
Installation
composer install adhocore/cli
Top comments (3)
This looks nice... very nice, will use someday ^_^
thanks for good words. would love to hear about what awesome thing you will be making out of it. 😊
Now supports autocomplete (for now in zsh only, but others might be improved)
github.com/adhocore/php-cli#autoco... :)