Command Line

Swoft provides powerful command line application processing. Svoft's http server, websocket server, etc. are all started and managed through the command line.


 composer require swoft/console 

Functional characteristics

  • Command line application, command line parsing run, automatic collection registration based on annotation @Command @CommandMapping
  • Support for setting aliases for commands and command groups. A command can have multiple aliases.
  • Full-featured command line option parameter parsing (named parameters, short options, long options...), command line input , output management, use
  • Notes automatically parse the command method to help (support @CommandOption @CommandArgument @example and other notes)
  • Support output of message texts in multiple color styles ( info , comment , success , warning , danger , error ... )
  • Commonly used special format information display ( section , panel , padding , helpPanel , table , 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 )
  • The color output is compatible with windows linux mac . Environments that do not support color will automatically remove the relevant CODE.
  • Support for coroutine and non-coroutine (traditional synchronous blocking) to run commands in two ways
  • Built-in Phar packaging tool class, you can easily package the application into a phar file, which is convenient to be distributed and used as a tool.
  • Quickly generate auto-completion scripts (TODO) for bash/zsh environments for current applications

swoft/console based on the improvement of inherit/php-console and refers to some of the features of symfony/console

Git warehouse

Participate in the contribution

Welcome to participate in the contribution, you can

  • Fork our development warehouse swewt/component
  • Modify the code and then initiate the PR
  • About PR launch of Notes