No Description

Inhere 5ed367d4cd fix get version error (#16) 1 month ago
docs 230dbcd37e add a image 11 months ago
examples 80d4bc45fd update some logic for group options 9 months ago
resource f660cd7fde rename dir res/ to resource/ 9 months ago
src dace994f44 fix get version error 1 month ago
test 51c05ec060 update: limit phpunit version to 7.5 4 months ago
.gitignore 5d0e21f2a2 fix some test error 9 months ago
.travis.yml 6be600906d formar some codes. use phpunit 7.5 for run ci test 4 months ago 671fb7f7af update readme 11 months ago
LICENSE cdc9481f55 some update, add a built-in controller for pack phar 2 years ago 9bc1e5f81a add struct return type 10 months ago 758033f03e update readme 10 months ago
_config.yml 565d2c3625 Set theme jekyll-theme-slate 1 year ago
composer.json 51c05ec060 update: limit phpunit version to 7.5 4 months ago b86104a312 update some logic, add more unit test 11 months ago
phpunit.xml.dist 59114a3b8f add some test 11 months ago 78c9113d4c update some class 1 year ago

PHP console

License Php Version Latest Stable Version

A simple, full-featured php command line application library. Provide console parameter parsing, command run, color style output, user information interaction, and special format information display.


Command line preview



Easy to use. Can be easily integrated into any existing project.

  • Command line application, controller, command parsing run on the command line
  • Support for setting aliases for commands. A command can have multiple aliases. Support command display/hide, enable/disable
  • Full-featured command line option parameter parsing (named parameters, short options, long options...). input, output of the command line, management, use
  • Command method comments are automatically parsed as help information (by default, @usage @arguments @options @example)
  • Support for outputting message texts of multiple color styles (info, comment, success, warning, danger, error ... )
  • Commonly used special format information display (section, panel, padding, helpPanel, table, tree, title, list, multiList)
  • Rich dynamic information display (pending/loading, pointing, spinner, counterTxt, dynamicText, progressTxt, progressBar)
  • Common user information interaction support (select, multiSelect, confirm, ask/question, askPassword/askHiddenInput)
  • Support for predefined parameter definitions like symfony/console (giving parameter values ​​by position, recommended when strict parameter restrictions are required)
  • The color output is windows linux mac compatible. Environments that do not support color will automatically remove the relevant CODE.
  • Quickly generate auto-completion scripts for the current application in the bash/zsh environment

Built-in tools

  • Built-in Phar packaging tool class, which can be easily packaged into phar files. Easy to distribute and use
    • Run the command php examples/app phar:pack in the example, which will package this console library into an app.phar
  • Built-in file download tool class under command line with progress bar display
  • Command line php code highlighting support (from jakub-onderka/php-console-highlighter and making some adjustments)
  • Simple Terminal screen, cursor control operation class
  • Simple process operations using classes (fork, run, stop, wait ..., etc.)

All features, effects; can be run in the example code phps/app in examples/. Basically covers all the features and can be tested directly

Quick installation

composer require inhere/console

Document List

Please go to WIKI for detailed usage documentation

Project address

Unit test

// output coverage without xdebug
phpdbg -dauto_globals_jit=Off -qrr /usr/local/bin/phpunit --coverage-text



My other projects