🖥 PHP CLI application library, provide console argument parse, console controller/command run, color style, user interactive, format information show and more. 功能全面的PHP命令行应用库。提供控制台参数解析, 命令运行,颜色风格输出, 用户信息交互, 特殊格式信息显示

Overview

PHP Console

License Php Version Latest Stable Version Github Actions Status

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 -s, long options --long).
  • The 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
  • NEW: Support start an interactive shell for run application

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

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

Comments
  • call 'onAppStop' service, if it is registered.

    call 'onAppStop' service, if it is registered.

    https://github.com/inhere/php-console/blob/2.x/src/Base/AbstractApplication.php#L212

            // call 'onAppStop' service, if it is registered.
            $this->fire(self::ON_STOP_RUN, $this);
    

    这里的 onAppStop service 怎么使用呢?

    question 
    opened by hs-llsong 6
  • execute() 方法语法错误时会报Call to a member function handle() on null

    execute() 方法语法错误时会报Call to a member function handle() on null

    execute($input, $output)方法语法错误时会报Call to a member function handle() on null 原因是 prepareRun 里面setter$this->errorHandler没有调用到

    Fatal error: Uncaught Error: Call to a member function handle() on null in /home/tester/vendor/inhere/console/src/Base/AbstractApplication.php:298
    Stack trace:
    #0 [internal function]: Inhere\Console\Base\AbstractApplication->handleException(Object(ParseError))
    #1 {main}
      thrown in /home/tester/vendor/inhere/console/src/Base/AbstractApplication.php on line 298
    
    Fatal error: Uncaught Error: Call to a member function handle() on null in /home/tester/vendor/inhere/console/src/Base/AbstractApplication.php:298
    Stack trace:
    #0 /home/tester/vendor/inhere/console/src/Base/AbstractApplication.php(285): Inhere\Console\Base\AbstractApplication->handleException(Object(ErrorException))
    #1 /home/tester/vendor/inhere/console/src/Base/AbstractApplication.php(270): Inhere\Console\Base\AbstractApplication->handleError(1, 'Uncaught Error:...', '/home/sll/Proje...', 298)
    #2 [internal function]: Inhere\Console\Base\AbstractApplication->Inhere\Console\Base\{closure}()
    #3 {main}
      thrown in /home/tester/vendor/inhere/console/src/Base/AbstractApplication.php on line 298
    
    bug 
    opened by hs-llsong 4
  • newByDocblock 方法报错

    newByDocblock 方法报错

    我的环境 mac inhere/console v4.0.4 php版本 7.4

    → php -v                           
    PHP 7.4.30 (cli) (built: Jun  9 2022 09:30:03) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
    
    → composer show -i | grep inhere
    You are using the deprecated option "installed". Only installed packages are shown by default now. The --all option can be used to show all packages.
    inhere/console                   v4.0.4             a php console library, provide console argument parse, console controller/command run, color style, user int...
    inhere/php-validate              v2.8.5             an simple validate, filter library of the php
    
    
    

    报错

    Argument 1 passed to Inhere\Console\Annotate\DocblockRules::newByDocblock() must be of the type string, bool given, called in  path/to//vendor/inhere/console/src/Handler/AbstractHandler.php on line 506
    
    

    我的 测试代码 , 按照文档

    <?php
    declare(strict_types = 1);
    
    namespace app\Command;
    
    use Inhere\Console\IO\Input;
    use Inhere\Console\IO\Output;
    
    class Test1 extends \Inhere\Console\Command
    {
        protected static $name = 'test';
    
        protected static $desc = 'print system ENV information';
    
        protected function execute(Input $input, Output $output)
        {
            $keywords = $this->flags->getOpt('search',23);
    
            $name = $this->flags->getFirstArg();
            if ( !$name && !$keywords) {
                // env | grep XXX
                $output->aList($_SERVER, 'ENV Information', ['ucFirst' => false]);
                return;
            }
    
            $output->info("do something ...");
        }
    }
    
    
    
     $meta = [
                'name' => 'My Console App',
                'version' => '1.0.2',
            ];
            $input = new Input;
            $output = new Output;
            // 通常无需传入 $input $output ,会自动创建
            $app = new \Inhere\Console\Application($meta, $input, $output);
    
            $app->command(Test1::class);
            $app->run();
    

    尝试修改 vendor里的 代码 行

       public function loadRulesByDocblock(string $method, FlagsParser $fs): void
        {
            $this->debugf('not config flags, load flag rules by docblock, method: %s', $method);
            $rftMth = PhpHelper::reflectMethod($this, $method);
    
            // parse doc for get flag rules
            $dr = DocblockRules::newByDocblock((string)$rftMth->getDocComment());
            $dr->parse();
    

    我把newByDocblock 方法的传参 bool 类型 强制转 string 可以修复

    接下来 报错如下

    flag option 'search' is undefined
    
    

    我看了下 是这行 search 传参 未传 ,但我给了默认值

    
      $keywords = $this->flags->getOpt('search',23);
    

    去掉这行 获取参数 则可以执行 案例代码 ,或许我 php版本 太低 ,目前使用的php7.4 。

    question 
    opened by guanhui07 2
  • 如何自定义命令的help(非子命令的help)

    如何自定义命令的help(非子命令的help)

    如图,希望能够自定义命令的help信息,包括usage和example信息,发现这些代码是在php-console/src/Traits/ApplicationHelpTrait.php里面写死的

            /** @var Output $out */
            $out = $this->output;
            $out->helpPanel([
                'usage'   => "$script <info>{command}</info> [--opt -v -h ...] [arg0 arg1 arg2=value2 ...]",
                'example' => [
                    "$script test (run a independent command)",
                    "$script home{$sep}index (run a command of the group)",
                    "$script help {command} (see a command help information)",
                    "$script home{$sep}index -h (see a command help of the group)",
                    "$script --auto-completion --shell-env [zsh|bash] [--gen-file stdout]",
                ]
            ]);
    

    是否有办法自定义这些输出

    1111

    question 
    opened by liudhzhyym 2
  • wrong type parameter was passed

    wrong type parameter was passed

    PHP Fatal error: Uncaught TypeError: Argument 3 passed to Inhere\Console\Utils\Show::table() must be of the type array, boolean given, called in ......

    opened by chenqinghe 2
  • 用mb_strwidth代替mb_strlen来测量字符串宽度,便于表格显示

    用mb_strwidth代替mb_strlen来测量字符串宽度,便于表格显示

    原本使用mb_strlen来测量字符串宽度,在中文环境不太准确,所以当改用mb_strwidth时,能够准确检测出显示时的宽度

    而填充时如果使用str_pad,则仍然会因为宽度测量不准确而不能准确填充,所以改为用拼接字符串的形式来填充,缺点是只能在字符串的首尾填充

    代码中新增的私有方法(padByWidth)就是用于此类填充,原本考虑加入到StringHelper类中,但考虑到它属于另一个仓库,所以直接加入到了当前类中,建议可以重新封装到合适的类中

    opened by charlestide 1
  • 为什么在静态调用输出对象的时候不支持type呢?

    为什么在静态调用输出对象的时候不支持type呢?

    show::info('111'); 的时候控制台会输出 [INFO] 1111

    是不是在参数中增加一个type

    看了下代码, 在魔术方法中 的type 直接获取了style

     $style = self::$blockMethods[$method];
     return self::block($msg, $style === 'primary' ? 'IMPORTANT' : $style, $style, $quit);
    

    目前项目中修改魔术方法中的参数获取,在使用静态调用的时候可以传递type, 想问下目前这样做的目的

    question 
    opened by ghost 1
  • chore(deps): bump actions/checkout from 2 to 3

    chore(deps): bump actions/checkout from 2 to 3

    Bumps actions/checkout from 2 to 3.

    Release notes

    Sourced from actions/checkout's releases.

    v3.0.0

    • Update default runtime to node16

    v2.4.0

    • Convert SSH URLs like org-<ORG_ID>@github.com: to https://github.com/ - pr

    v2.3.5

    Update dependencies

    v2.3.4

    v2.3.3

    v2.3.2

    Add Third Party License Information to Dist Files

    v2.3.1

    Fix default branch resolution for .wiki and when using SSH

    v2.3.0

    Fallback to the default branch

    v2.2.0

    Fetch all history for all tags and branches when fetch-depth=0

    v2.1.1

    Changes to support GHES (here and here)

    v2.1.0

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • fix get version error

    fix get version error

    fix error detail :

    [ERROR] An error occurred! MESSAGE: Argument 2 passed to Inhere\Console\Util\Show::aList() must be of the type string, null given, called in E:\Dev\Code\New\php-redis-cli\vendor\inhere\console\src\Traits\FormatOutputAwareTrait.php on line 150
    
    bug 
    opened by WangNingkai 0
  • fixed:table opts error

    fixed:table opts error

    原来的代码只能修改showBorder,使用$output->table()这个的时候就不对了

    array(10) {
      ["showBorder"]=>
      array(2) {
        ["showBorder"]=>
        bool(true)
        ["columns"]=>
        array(3) {
          [0]=>
          string(2) "ID"
          [1]=>
          string(12) "时间"
          [2]=>
          string(6) "邮箱"
        }
      }
      ["leftIndent"]=>
      string(2) "  "
      ["titlePos"]=>
      string(1) "l"
      ["titleStyle"]=>
      string(4) "bold"
      ["headStyle"]=>
      string(7) "comment"
      ["headBorderChar"]=>
      string(1) "="
      ["bodyStyle"]=>
      string(0) ""
      ["rowBorderChar"]=>
      string(1) "-"
      ["colBorderChar"]=>
      string(1) "|"
      ["columns"]=>
      array(0) {
      }
    }
    
    opened by sy-records 0
  • 如何动态提取参数?

    如何动态提取参数?

    WIKI没看到相应的文档

    1. param*是动态的 如何获取使用?
    app.php a:{param1} b:{param2}
    
    1. 如何忽略一些固定位置的argv
    app.php {fixed_position}  test:test
    ...
    [ERROR] The command 'fixed_position' is not exists!
    
    question 
    opened by lkeme 4
Releases(v4.1.5)
  • v4.1.5(Jan 3, 2023)

    Change Log

    Feature

    • feat: support micro sapi mode https://github.com/inhere/php-console/commit/54102f0cbb3d379aee07d70d02b26fc182d368f2

    Update

    • up: update indent space for list data format https://github.com/inhere/php-console/commit/59d0b61443a2ae2a7bfca37513a7509f16565f54
    • up: dont split show group and alone commands https://github.com/inhere/php-console/commit/d5fec40398ffe9a5c9cf601304a28cab329be772
    • up: update some for format and not found handle https://github.com/inhere/php-console/commit/5e3d2d3de2bcb37eb210c2755c117ed07cfc4904
    • up: support fire event on sub-cmd and set app to sub-cmd https://github.com/inhere/php-console/commit/a272ae3eceaf8d1084041138ba2f56193c23e286

    Fixed

    • fix: title formatter var type maybe not fixed https://github.com/inhere/php-console/commit/202cef46c8198e244e94fd87b1af50cc61020f61
    • fix: type error on issues #29 https://github.com/inhere/php-console/commit/2c2fc3306c6b2af18b45a0f4dd986a72350cd9ce
    • fix: unit test error on subcommands https://github.com/inhere/php-console/commit/04e5fdbebcc65889d15e32e1993e52fa477b67b9

    What's Changed

    • feat: support micro sapi mode by @lihq1403 in https://github.com/inhere/php-console/pull/28
    • fix: type error on issues #29 by @nelsonsun in https://github.com/inhere/php-console/pull/30

    New Contributors

    • @lihq1403 made their first contribution in https://github.com/inhere/php-console/pull/28
    • @nelsonsun made their first contribution in https://github.com/inhere/php-console/pull/30

    Full Changelog: https://github.com/inhere/php-console/compare/v4.1.4...v4.1.5

    Source code(tar.gz)
    Source code(zip)
  • v4.1.4(May 11, 2022)

    Change Log

    Update

    • up: update some for error handler render exception https://github.com/inhere/php-console/commit/7720ce7579898d727ad83d985f68b69ccae77c22
    • up: update some for add global option https://github.com/inhere/php-console/commit/41067a5e0181379efe4ebe291320d259887681f8
    • update: update some logic for show simple list https://github.com/inhere/php-console/commit/b57d62f62f039e083bf5c6312efceb9a630d1161

    Fixed

    • fix: use 'top sub' access command error https://github.com/inhere/php-console/commit/a09383d06c16a989695824d13f2504745fd3df49
    • fix: fix some error for run sub cmd https://github.com/inhere/php-console/commit/fdcf1c678a2e04d2ac2bcc3e60601401fe6084bb
    Source code(tar.gz)
    Source code(zip)
  • v4.1.3(Mar 25, 2022)

    Change Log

    Update

    • up: update some logic for run sub commands https://github.com/inhere/php-console/commit/40b4cc8b33537848f6c43701a2b4b274caa270ee

    Other

    • chore(deps): bump actions/checkout from 2 to 3 https://github.com/inhere/php-console/commit/a3e0851b3d9180040a8989ab91e3487e12cb68f1
    Source code(tar.gz)
    Source code(zip)
  • v4.1.2(Jan 29, 2022)

    Change Log

    Feature

    • feat: support render attached subcommand help https://github.com/inhere/php-console/commit/43e04954b413805ed7d5a9b8fcef01d719ec790c

    Update

    • up: update some for output class https://github.com/inhere/php-console/commit/472997957cceca98db8c738546a0a94551b70b50
    • up: remove some depercated methods, modify command flag option https://github.com/inhere/php-console/commit/71c0b4a6e0db98ffb4a0891c65fc6f7bd9c15e41

    Fixed

    • fix: phar compiler prop: modifies not init https://github.com/inhere/php-console/commit/bf25644c849be9a590d36ea83000f7a6c6c274d1
    Source code(tar.gz)
    Source code(zip)
  • v4.1.1(Dec 26, 2021)

    Change Log

    Update

    • up: update group command help render https://github.com/inhere/php-console/commit/045e0ddedd57b132ea8d3c198238c166c1732930

    Feature

    • feat: support add flags config for add alone Closure command https://github.com/inhere/php-console/commit/6a4b640267442a8a1ad2c3758cf36b7f326dff04
    • feat: allow attch multi level sub-commands to command,group https://github.com/inhere/php-console/commit/d1f9829db9b0d331fdf556bb2b95e1040050b63d

    Fixed

    • fix: uint tests error https://github.com/inhere/php-console/commit/4dfe19fe6f9c989b17e2a183e188338df65b3dfd

    Other

    • refacting: update all use cli color tag class https://github.com/inhere/php-console/commit/07a1e51e10a43b84f9aeecafbf5c6cccd0efa139
    • perf(io): update some use io class logic https://github.com/inhere/php-console/commit/5b887a4483bb2ba7233cd5f2060e3329c73a28d4
    • :necktie: refactor(router): move router class to component dir https://github.com/inhere/php-console/commit/c1d43564083420aff9850461044a62e86bca1338
    • chore: delete deprecated class files https://github.com/inhere/php-console/commit/ee2d8a1d59c797b2cb61a8d9408d719ecc6a49de
    • breaking: update command register method sign https://github.com/inhere/php-console/commit/d94eeeee703853da774f05d5bc15b4674fe1af7d
    • chore: replace all description prop to desc https://github.com/inhere/php-console/commit/ef50e5c0115befd4c9c19186219f8bd0efffaec4
    • refactor: move some trait class to Decorate dir https://github.com/inhere/php-console/commit/c913803666a688e4102aad63f3254eb6607443d2
    • refactor: move io abstract class to Concern dir https://github.com/inhere/php-console/commit/bc61390c2066225f37da0f0b93bb0dab0331fc4d
    • refactor: move some abstract class to Concern dir https://github.com/inhere/php-console/commit/7259524fc0a13e8b142ac509446900caba221110
    • refactor: update handler construct sign, add some tests https://github.com/inhere/php-console/commit/1119e7fa59c50a1f96e96a94ea0e6f4866b080a5
    • chore: add more tests for run group commadn https://github.com/inhere/php-console/commit/cce98504a0ad71681c5750ffc41e2cfce6e08ab4
    Source code(tar.gz)
    Source code(zip)
  • v4.1.0(Dec 9, 2021)

    Change Log

    Fixed

    • fix: phar package build error, add test build on ci tests https://github.com/inhere/php-console/commit/2c35c386c80ea034eed085de49a0a38998790218

    Update

    • up: remove some util methods https://github.com/inhere/php-console/commit/be119333a81cf3db12bb497293915b75efe81f48
    • up: update dep toolkit/pflag to 2.0 https://github.com/inhere/php-console/commit/ae9e9f615b2c5de2e3b05f61b7d09c7bcb85fc54

    Other

    • breaking: begin v4.1.x, require php 8.0+ https://github.com/inhere/php-console/commit/1a386f1c3cd726e18634d8483b3e86ee230e28e5
    • chore: update action script, only test on php 8.0+ https://github.com/inhere/php-console/commit/edf350afa9d7bddaa27deb8203a5e8a18151dcfb
    • chore: add tests on php 8.1, update readme https://github.com/inhere/php-console/commit/001ca21e50c4584e12ebc49c48bf7b32c73c274a
    • style: run code inspect for src/Component https://github.com/inhere/php-console/commit/cc52396f6fe68189f9ef04b39f147129254edf81
    • style: run code inspect for src/IO src/Concern https://github.com/inhere/php-console/commit/8195fbd60ae5d567abc41ba4fecef88a59da927c
    • style: run code inspect for src/BuiltIn Util https://github.com/inhere/php-console/commit/45f0a1a632bc2caaf65b96306e468d64f50b0ed1
    • style: run code inspect for test example resource https://github.com/inhere/php-console/commit/c5bc385621fb7941b1932102b6c9adc87a078bb9
    • style: run code inspect for some class https://github.com/inhere/php-console/commit/7611abac7c4d7e9c777c8f68aebe42a7e290c828
    • breaking: update some toolkit deps to 2.0 https://github.com/inhere/php-console/commit/ee9ce7f08ffeeda7ca9f9087cc50443883bf9b2f
    Source code(tar.gz)
    Source code(zip)
  • v4.0.4(Nov 26, 2021)

    Change Log

    Update

    • up: AbstractHandler add new prop:desc instead the prop:description https://github.com/inhere/php-console/commit/9cc675a77652490a11ba4127dd6ac7af5274f5f0
    • up: update some output format methods https://github.com/inhere/php-console/commit/321d252d2b1d66d79f9fb3c078de7b98eef31ad4

    Fixed

    • fix: echoln and json cli pretty error https://github.com/inhere/php-console/commit/973fd28e6107128cb93cc1027b45de80ec308e1a

    Other

    • style: update some for help render https://github.com/inhere/php-console/commit/4517972afab71eaddf0c46423ffb4c3d13e20ace
    Source code(tar.gz)
    Source code(zip)
  • v4.0.3(Nov 9, 2021)

    Change Log

    Fixed

    • fix: Undefined property: Inhere\Console\IO\Output:: https://github.com/inhere/php-console/commit/907e556cb740ca5a0f70bf5bc65b04f2cbfc9003

    Update

    • update: stdlib class name changed https://github.com/inhere/php-console/commit/257dd87432caa920634b56b0541818b72928ef66

    Other

    • chore: update some for cli json render https://github.com/inhere/php-console/commit/8c5eb38b8a35d28cf88d6b75e9419d8f3af62c37
    • prof: add some useful methods https://github.com/inhere/php-console/commit/a254803242880d77134ce1ea0da1a41e2ce5fc43
    Source code(tar.gz)
    Source code(zip)
  • v4.0.2(Oct 27, 2021)

    Change Log

    Fixed

    • fix: dep package toolkit/fsutil not added https://github.com/inhere/php-console/commit/32f386f8fc78d8903a588ed4422d47a12b640398

    Other

    • refactor: refacting the input output class. https://github.com/inhere/php-console/commit/6f9705025d1c08686367f8e2cfa9fad8eaca5b36
    Source code(tar.gz)
    Source code(zip)
  • v4.0.1(Oct 27, 2021)

    Change Log

    Update

    • up: gen changelog on relase new tag https://github.com/inhere/php-console/commit/bd7e047f912ed602d1981310c72249dc726abbbd

    Feature

    • feat: add more common methods for group/command https://github.com/inhere/php-console/commit/323ae9b3dcff0a31b602f4d72189cb5d29592b9c
    • feat: add new formatter for pretty JSON render https://github.com/inhere/php-console/commit/cd448f26078140604b1ba37dfee5b13dfdefce8b

    Fixed

    • fix: select component assert default is empty error https://github.com/inhere/php-console/commit/5ff2d149843ec78795adfeea9178f628a104145e

    Other

    • sytle: update readme https://github.com/inhere/php-console/commit/bb7c1ecd2396594ca652acc51e71fd175d449e22
    • sytle: update readme, add more doc on readme https://github.com/inhere/php-console/commit/28bd7a24ddd1bbb0b8090ee841122ec9c25c877b
    • chore: update readme and some method comments https://github.com/inhere/php-console/commit/106d72bec300980826219b526403503c886dc0fd
    • chore: update readme https://github.com/inhere/php-console/commit/9285fe0bcd8b9a58cd7a8233c20a181709665bde
    • refactor: remove some not used intpu methods https://github.com/inhere/php-console/commit/0350a915cd7212e0907ebf990936db7e802c1149
    • breaking: remove more unused input methods https://github.com/inhere/php-console/commit/ba69f2e55f5b7bdeef2affaa8a3680fba4b48242
    • breaking: rename flag package methods https://github.com/inhere/php-console/commit/a90478f356400e79976bd1f86627cde778138f71
    • chore: update some for format message render https://github.com/inhere/php-console/commit/e4a269512151bda1c029a9f536acb7d6e60531af
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(Oct 14, 2021)

    Change Log

    Fixed

    • fix: inner method dipplay on help. https://github.com/inhere/php-console/commit/c605220112cef8c3369d8731cb7b17ceda30281d
    • fix some error on ishell env https://github.com/inhere/php-console/commit/c92753ca08aaedc4d72d32aa47a64483581ca38f
    • fix: method docs parse error on multi line https://github.com/inhere/php-console/commit/87c8fffee34b333bdfea6c4e77cfe3659f021935
    • style: run cs fix for all php files https://github.com/inhere/php-console/commit/d237b6ba6c66855d94a83560f47605e9f5ade228

    Update

    • update some for built in command https://github.com/inhere/php-console/commit/40a18a55e2fd70767a10fcf615054f991133029f
    • update some examples https://github.com/inhere/php-console/commit/2d5708f9f553d925f6b8cc51dee589cf700da025

    Other

    • enhance: will display group options on group/command help https://github.com/inhere/php-console/commit/05a433796d5c33437827fbbeb75417dc07ad025e
    • breaking: delete some Input methods, use flags instead the input https://github.com/inhere/php-console/commit/3e06b079bd022903a6af725b6084a2000856253e
    • breaking: remove more not used methods and class https://github.com/inhere/php-console/commit/71d41b127317eb65536c9512c7edc2c151641233
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0beta2(Sep 29, 2021)

  • v4.0.0beta1(Sep 24, 2021)

    Change Log

    Update

    • up: update some flag logic https://github.com/inhere/php-console/commit/1cb7ccea2225dafb6d4ead0a7f62344e74479b80
    • update readme, update default screenshots image https://github.com/inhere/php-console/commit/2b43156fe0316e1e5cebf15c616ad5a23d4e5f37
    • update some flag parse logic https://github.com/inhere/php-console/commit/b819685d766bf339dd0c94fc6e430fdbd890c305
    • add new method for print JSON https://github.com/inhere/php-console/commit/6934fc4bebe8ef932ed8115ed3933b95783ea415
    • up: update the list data show logic https://github.com/inhere/php-console/commit/28f6cd0bff3ddba91abec00a4d864fe948ec5365
    • update some for phar building https://github.com/inhere/php-console/commit/5181a372e1eca9dafc9160fe146eb00c599ad658
    • add some new idea for flags parse https://github.com/inhere/php-console/commit/6b0881c9750577ca40e7c7308d4d7970d064b2e9
    • add more setting for flags parse https://github.com/inhere/php-console/commit/f74ec9c3d1eb612320c45f7d444e9c3d6aebafde
    • update: move Flag classes to package toolkit/pflag https://github.com/inhere/php-console/commit/0cd1c346d11a5e922e4dc5f7d083d1620c980db7
    • update some for handle error https://github.com/inhere/php-console/commit/3924621b65d6ec5a7406003da592b9dfb914ff59
    • update gh action scripts, add mew method to app class https://github.com/inhere/php-console/commit/3001e1ddcd07466faf39fc2626a9484de0dd6caf
    • update some https://github.com/inhere/php-console/commit/a9a98f2e31eb9532c086a7c85d7c3857d2fca881
    • update some for global options https://github.com/inhere/php-console/commit/04b012622721e214ac13644387d643a34fe7c34a
    • update some for choose logic https://github.com/inhere/php-console/commit/1e14a53aaae1787eea8c6aa52de1777b14c14aec
    • update some logic for controller action run https://github.com/inhere/php-console/commit/dbba4c2b4882392908f556792cacb336c1884485
    • update some logic for config subcommand flags https://github.com/inhere/php-console/commit/58b05677ea8703e62a018abdf76fa4224480d12b
    • update some command error handle logic https://github.com/inhere/php-console/commit/9f6c6c39dc375d49eab21a78b7456bebcfee2e74
    • update soem for run group subcommand https://github.com/inhere/php-console/commit/3e19677bd6eb1225d4a4ada4595edad185daeb99
    • update some for examples https://github.com/inhere/php-console/commit/0524147ea964bbe548b86fa9f1f1174bc83b65cc
    • up: use new flags replace the input object https://github.com/inhere/php-console/commit/b2ee9dd84b63103d4e128f62ff5efa7ba18c4c56
    • Update Choose.php https://github.com/inhere/php-console/commit/e799fc4e787b549281262cdab051ac22c91aaaf9
    • up readme. require php >= 7.3 https://github.com/inhere/php-console/commit/d7ac28c167e6e33ea28d74eccf240f1ce07665e0
    • up: update the github action script https://github.com/inhere/php-console/commit/a86db072c484df48bbc4a744b21419d44258192a
    • refeator: command and subcommand help render by flags parser https://github.com/inhere/php-console/commit/391938b48331c5c10fae5c11dae1b2bfd790ff1d

    Feature

    • feat: add more event trigger on command run https://github.com/inhere/php-console/commit/b06ef05c6dc2bdd41df4f4d9737fc2b006dea1c3
    • feat: add more events fire point https://github.com/inhere/php-console/commit/46f58b366370ef0c1627eb6761ebac145106e0e3
    • feat: add new method for check many option exists https://github.com/inhere/php-console/commit/53485de5cc367e3284d41c518f10195bda2f91cc
    • feat: add an new simple flags parser https://github.com/inhere/php-console/commit/e90ec3187b69f1a2d5f69d17e4cc9293387f1a90
    • feat: update some logic for run group action https://github.com/inhere/php-console/commit/ce757606001eab27e846a8f464ac34e6aa6a084f
    • feat: support parse flag rules by method docComment https://github.com/inhere/php-console/commit/8d8b6afacc0130ee66a77d6eeb803501045a6b02
    • enhance: parse method doc comments enhance https://github.com/inhere/php-console/commit/eec62e3e2134f870b66fef1c7086a68af7464477
    • enhance: support auto indent multi line text on command help https://github.com/inhere/php-console/commit/7d6b84500a53baa61826ca2021d7b24e6e6959e4

    Fixed

    • fix: command id should use real command name https://github.com/inhere/php-console/commit/485d65f6c0b97df1b420d89f4736d0e31af9c3db
    • fix run controller error https://github.com/inhere/php-console/commit/6fa7b4b5bc76911bd5fe48b9463cab4d5dd6a351
    • fix parse method comments as flag rules https://github.com/inhere/php-console/commit/115a071b5166855de3df57c8eddc4fae2457ce94
    • fix an error for parse method comments https://github.com/inhere/php-console/commit/661a36b4fe5681395fef9f5f9bb78f31d9b3ed55
    • Fix invalid default value of Choose::one https://github.com/inhere/php-console/commit/799d22bb0f3f942c476b98eeaa1beddfb71d3ab5
    • fix: some flags error on built in command method comments https://github.com/inhere/php-console/commit/fb34f323576b1f8785f84a551e42979a67b0ef61
    • fix: command help vars not replace as value https://github.com/inhere/php-console/commit/41db27d75b8d00858cc599157a23cd0209d9e205

    Other

    • breaking: change command run() params type https://github.com/inhere/php-console/commit/d68c789d4eea66a90e496950bd84ea4447ff1279
    • refact: mv some class https://github.com/inhere/php-console/commit/b29df83f11eab24150d5d5ed3e1648e9a3680a8b
    • style: update readme image links https://github.com/inhere/php-console/commit/8d5c2ffd95df9fc98be3c16b3f734a561b8cd360
    • refactor: move input flag class to Flag namespace https://github.com/inhere/php-console/commit/0646bc8ec920b4fc6f84c1138802fc1591627d2c
    • refactor: rename some flag class https://github.com/inhere/php-console/commit/fb101ad5ce240321152c487d9b3c79de1ec68c6c
    • replase some deprecated methods https://github.com/inhere/php-console/commit/f92f411ff4857bab8e48581f6c518540e83e7ad8
    • repleace some util methods https://github.com/inhere/php-console/commit/8520aebf32ba21a0e630a7386c3628bbdc8e4eb2
    • refactor input output logic https://github.com/inhere/php-console/commit/2fed8f3e3d041fda3cb982fa984f5ebcbaee1d60
    • remove some unused class https://github.com/inhere/php-console/commit/b0a63e890a345cd4e5f80fd027c6a33268d10b13
    • remove some empty class https://github.com/inhere/php-console/commit/d46ddc1b0b643e63bd1b687746a27a431501e6fa
    • remove some old methods, update some method param define. https://github.com/inhere/php-console/commit/496bb5cfde5a5068200c2274983dd0f9218b64f1

    Full Changelog: https://github.com/inhere/php-console/compare/v3.1.21...v4.0.0beta1

    Source code(tar.gz)
    Source code(zip)
  • v3.1.21(Aug 8, 2021)

    Change Log

    Update

    • add tests on php 8 https://github.com/inhere/php-console/commit/26870f2de20585578ba55f3a6affdc23aa9a735a
    • up: update default prop value for PhpDevServe https://github.com/inhere/php-console/commit/cd8a8fd9db11c3c8daa7bf17a013637f488226b7
    • up: action limit the phpunit version on php 7.2 https://github.com/inhere/php-console/commit/f278bcf65a7ad4e66c6fb8eaf5198520f93e4a2c
    • up: modify the group action not found logic https://github.com/inhere/php-console/commit/9c923161299bbef672928cf841156b5b2c9b47ef
    • update the phpunit version limit https://github.com/inhere/php-console/commit/b2a904fee0ee940e295f0b57333236d0b1090b96
    • update message show for php dev server https://github.com/inhere/php-console/commit/75b8817ffc0df4388dd1e51df2feaceec4ea5895
    • update some logic for php serve https://github.com/inhere/php-console/commit/1c98e59f41265c9b9215e540f6b33cb2f80e9f90
    • up: support set env vars on start php serve https://github.com/inhere/php-console/commit/d4286e05f72f2fc067660f2d0c4bfd48c70a9d8b
    • update the default error message text https://github.com/inhere/php-console/commit/cb6f8c79ffaa842c9c58cabce6b6a62918f16e33
    • update some for gen auto complete scripts https://github.com/inhere/php-console/commit/5d8b274775e4c866bb8564eec9f2fbd5227900c8
    • add some shell completion refer files https://github.com/inhere/php-console/commit/564ee5b72082a9054f4fbdec7aee9982fc4687d7
    • update template file for gen zsh https://github.com/inhere/php-console/commit/c57f161bffb95e9e11e6b9c98c80ed4cf958e47b
    • add an config prop at handler https://github.com/inhere/php-console/commit/9396e2ad110ac99f07ba4aad3dae966d3eba15ef
    • update some for app https://github.com/inhere/php-console/commit/513fd1cdb84ee6a7ebb52589508da910d771fcbe
    • up: update some for input parse https://github.com/inhere/php-console/commit/3dc6e4e25e931f1959b62384661b06290000f552
    • up: update some output format and input parse https://github.com/inhere/php-console/commit/99966d79b3617cd035865528f26b2b41b9b91555
    • update some for base input class https://github.com/inhere/php-console/commit/8e39a95cb8a7875de271395bc8735cc358c67a26

    Fixed

    • fix: command comment var error on render subcommand help https://github.com/inhere/php-console/commit/d0fe63895cb411339450e5bb4ec097d6c9ea79f6
    • fix: doc root parse error for php serve https://github.com/inhere/php-console/commit/68001ef3bbc567ca395e22fcaf722befcfa0df59
    • fix: var type error on render help https://github.com/inhere/php-console/commit/1bd802b1bfc539797a9425b193a4e54a59184c58
    • fix: add newline after writef log https://github.com/inhere/php-console/commit/a268196a6ff3d645c81bfdc6b16382c52f7602d5

    Feature

    • feat: add an new simple interactive shell componnent https://github.com/inhere/php-console/commit/ce1e7f5b6bef201cbf76d51930937937b5b3f601
    • feat: add new method getSameIntOpt on input https://github.com/inhere/php-console/commit/2215ffe8a3576414714a013ca82d1815db0eb194
    Source code(tar.gz)
    Source code(zip)
  • v3.1.20(Apr 26, 2021)

  • v3.1.19(Apr 19, 2021)

  • v3.1.18(Jan 28, 2021)

  • v3.1.17(Jan 24, 2021)

  • v3.1.16(Jan 23, 2021)

  • v3.1.15(Dec 28, 2020)

  • v3.1.12(Jun 19, 2020)

  • v3.1.5(Nov 10, 2019)

  • v3.1.4(Oct 19, 2019)

  • v2.4.3(Mar 29, 2019)

  • v3.1.2(Feb 22, 2019)

  • v3.1.1(Feb 20, 2019)

  • v3.1.0(Jan 20, 2019)

  • v3.0.2(Jan 7, 2019)

  • v3.0.0(Jan 1, 2019)

  • v2.4.0(Jul 4, 2018)

    • update deps: add dep toolkit/cli-utils and toolkit/sys-utils
    • fix: no des when display alone command help
    • add new interactive method: Interact::answerIsYes()
    • update PharCompiler.php, some bug fixed
    • adjust help information display
    • remove some invalid classes
    Source code(tar.gz)
    Source code(zip)
Owner
Inhere
PHP and Go developer. @swoft-cloud, @gookit, @php-toolkit @php-comp
Inhere
A PHP library for command-line argument processing

GetOpt.PHP GetOpt.PHP is a library for command-line argument processing. It supports PHP version 5.4 and above. Releases For an overview of the releas

null 324 Dec 8, 2022
A PHP library for command-line argument processing

GetOpt.PHP GetOpt.PHP is a library for command-line argument processing. It supports PHP version 7.1 and above. Releases For an overview of the releas

null 324 Dec 8, 2022
Another Command Line Argument Parser

Optparse — Another Command Line Argument Parser Install 1. Get composer. 2. Put this into your local composer.json: { "require": { "chh/optparse

Christoph Hochstrasser 18 Nov 1, 2019
Extendable Interactive Make Command for Laravel

Extendable Interactive Make Command for Laravel Make your life easier with interactive make command! Installation composer require hydreflab/laravel-m

Hydref Lab 37 Nov 29, 2022
Generic PHP command line flags parse library

PHP Flag Generic PHP command line flags parse library Features Generic CLI options and arguments parser. Support set value data type(int,string,bool,a

PHP Toolkit 23 Nov 13, 2022
Console - The Console component eases the creation of beautiful and testable command line interfaces.

Console Component The Console component eases the creation of beautiful and testable command line interfaces. Sponsor The Console component for Symfon

Symfony 9.4k Jan 7, 2023
A powerful command line application framework for PHP. It's an extensible, flexible component, You can build your command-based application in seconds!

CLIFramework CLIFramework is a command-line application framework, for building flexiable, simple command-line applications. Commands and Subcommands

Yo-An Lin 428 Dec 13, 2022
🤖 GitHub Action to run symfony console commands.

Symfony Console GitHub Action Usage You can use it as a Github Action like this: # .github/workflows/lint.yml name: "Lint" on: pull_request: push

Nucleos 3 Oct 20, 2022
An Interactive Shell to Lumen Framework.

ABANDONED Please consider to use the official Laravel Tinker, it is also compatible with Lumen: laravel/tinker Lumen Artisan Tinker An Interactive She

Vagner Luz do Carmo 112 Aug 17, 2022
☄️ PHP CLI mode development framework, supports Swoole, WorkerMan, FPM, CLI-Server

☄️ PHP CLI mode development framework, supports Swoole, WorkerMan, FPM, CLI-Server / PHP 命令行模式开发框架,支持 Swoole、WorkerMan、FPM、CLI-Server

Mix PHP 1.8k Jan 3, 2023
Simple and customizable console log output for CLI apps.

Console Pretty Print Simple and customizable console log output for CLI apps. Highlights Simple installation (Instalação simples) Very easy to customi

William Alvares 3 Aug 1, 2022
Simple command-line tool to access HiWeb account information

Simple command-line tool to access HiWeb account information.

Milad Nekofar 2 Dec 26, 2022
WP-CLI Trait Package Command

WP-CLI Trait Package Command Generate plugin or php model files e.g. post-type or taxonomy for WP-Trait Package in Develop WordPress Plugin. Installat

Mehrshad Darzi 2 Dec 17, 2021
Sylius plugin to define a command cli context (ChannelContext)

Cli Context Plugin This plugin provide a default channel context for your Symfony Command. When Sylius load a resource implements Sylius\Component\Res

null 4 Dec 15, 2022
The Platform.sh CLI is the official command-line interface for Platform.sh

The Platform.sh CLI is the official command-line interface for Platform.sh. Use this tool to interact with your Platform.sh projects, and to build them locally for development purposes.

Platform.sh 222 Dec 29, 2022
Image Optimize Command - Easily optimize images using WP CLI

Image Optimize Command is a WP CLI wrapper for spatie/image-optimizer which optimize gif, jpeg, jpg, png, svg, webp images by running them through a chain of various image optimization tools.

Typist Tech Limited 157 Dec 13, 2022
Cecil is a CLI application that merges plain text files (written in Markdown), images and Twig templates to generate a static website.

Cecil is a CLI application that merges plain text files (written in Markdown), images and Twig templates to generate a static website.

Cecil 209 Jan 2, 2023
An Elegant CLI Library for PHP

Commando An Elegant PHP CLI Library Commando is a PHP command line interface library that beautifies and simplifies writing PHP scripts intended for c

Nate Good 793 Dec 25, 2022
Library for creating CLI commands or applications

Console Motivation: this library purpose is to provide a lighter and more robust API for console commands and/or applications to symfony/console. It c

Théo FIDRY 16 Dec 28, 2022