PHP Console Application made easy

github logo ใƒป1 min read

adhocore / php-cli

PHP Console Application made easy- build great console apps with ease


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)
  • For PHP7 and for good

Screen Preview

What's included

Core: Argv parser ยท Cli application

IO: Colorizer ยท Cursor manipulator ยท Stream writer ยท Stream reader


composer require adhocore/cli


As argv parser

$command = new Ahc\Cli\Input\Command('rmdir', 'Remove dirs');
    // 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 subdirs (`with` means false

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


composer install adhocore/cli

twitter logo DISCUSS (3)
markdown guide

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

Classic DEV Post from Jul 21

What's hard about React Hooks for you?

React Hooks are amazing, but require a learning curve... What's it been like for you?

Jitendra Adhikari profile image
Hello World!