Skip to content
PHP CLI application library, provide console argument parse, console controller/command run, color style, user interactive, format information show and more. 功能全面的PHP命令行应用库。提供控制台参数解析, 命令运行,颜色风格输出, 用户信息交互, 特殊格式信息显示
Branch: master
Clone or download
Latest commit a5c886a Apr 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
examples
resource rename dir res/ to resource/ Feb 22, 2019
src format Show::class codes Apr 14, 2019
test fix some test error Feb 22, 2019
.gitignore fix some test error Feb 22, 2019
.travis.yml
CHANGELOG.md update readme Jan 5, 2019
LICENSE some update, add a built-in controller for pack phar Oct 27, 2017
README.md add struct return type Feb 2, 2019
README_cn.md
_config.yml Set theme jekyll-theme-slate Feb 1, 2018
composer.json update some info Jan 15, 2019
phar.build.inc update some logic, add more unit test Jan 1, 2019
phpunit.xml.dist
sami.doc.inc update some class May 7, 2018

README.md

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.

中文README

Command line preview

app-command-list

Features

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

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

License

MIT

My other projects

You can’t perform that action at this time.