loading...

PHP Console Application made easy

adhocore profile image Jitendra Adhikari ・1 min read

GitHub logo 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.

Latest Version Travis Build Scrutinizer CI Codecov branch StyleCI Software License

  • Command line application made easy
  • Inspired by nodejs commander (thanks tj)
  • Zero dependency.
  • For PHP7 and for good

Screen Preview

What's included

Core: Argv parser · Cli application · Shell

IO: Colorizer · Cursor manipulator · Stream writer · Stream reader

Other: Autocompletion

Installation

composer require adhocore/cli

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 required, `[name]` for optional
    ->option('-s --with-subdir', 'Also delete

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

Discussion

markdown guide
 

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... :)