Full-featured php command line application library.
Provide console parameter parsing, command run, color style output, user information interaction, and special format information display.
NOTICE: Current version v4.1+, require PHP 8.0+
Easy to use. Can be easily integrated into any existing project.
controller
, command
parsing run on the command line-s
, long options --long
).input
, output
of the command line, management, use@usage
@arguments
@options
@example
)info
, comment
, success
, warning
, danger
, error
... )section
, panel
, padding
, helpPanel
, table
, tree
, title
, list
, multiList
)pending/loading
, pointing
, spinner
, counterTxt
, dynamicText
, progressTxt
, progressBar
)select
, multiSelect
, confirm
, ask/question
, askPassword/askHiddenInput
)symfony/console
(giving parameter values by position, recommended when strict parameter restrictions are required)windows
linux
mac
compatible. Environments that do not support color will automatically remove the relevant CODE.bash/zsh
environmentphar
files. Easy to distribute and use
php examples/app phar:pack
in the example, which will package this console library into an app.phar
jakub-onderka/php-console-highlighter
and making some adjustments)All features, effects; can be run in the example code
phps/app
inexamples/
. Basically covers all the features and can be tested directly
composer require inhere/console
Please go to WIKI for detailed usage documentation
phpunit
// output coverage without xdebug
phpdbg -dauto_globals_jit=Off -qrr /usr/local/bin/phpunit --coverage-text
You can set debug level by ENV CONSOLE_DEBUG=level
, global option --debug level
# by ENV
$ CONSOLE_DEBUG=4 php examples/app
$ CONSOLE_DEBUG=5 php examples/app
# by global options
$ php examples/app --debug 4
Check out these projects, which use https://github.com/inhere/php-console :
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。