-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
166 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# PHP Console | ||
|
||
[![License](https://img.shields.io/packagist/l/inhere/console.svg?style=flat-square)](LICENSE) | ||
[![Php Version](https://img.shields.io/badge/php-%3E=7.3.0-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/inhere/console) | ||
[![Latest Stable Version](http://img.shields.io/packagist/v/inhere/console.svg)](https://packagist.org/packages/inhere/console) | ||
[![Github Actions Status](https://github.com/inhere/php-console/workflows/Unit-tests/badge.svg)](https://github.com/inhere/php-console/actions) | ||
|
||
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](./README.zh-CN.md)** | ||
## Command line preview | ||
|
||
![app-command-list](https://raw.githubusercontent.com/inhere/php-console/3.x/docs/screenshots/app-command-list.png) | ||
|
||
## 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 | ||
|
||
```bash | ||
composer require inhere/console | ||
``` | ||
|
||
## Document List | ||
|
||
> Please go to WIKI for detailed usage documentation | ||
- **[Document Home](https://github.com/inhere/php-console/wiki/home)** | ||
- **[Feature Overview](https://github.com/inhere/php-console/wiki/overview)** | ||
- **[Install](https://github.com/inhere/php-console/wiki/install)** | ||
- **[Create Application](https://github.com/inhere/php-console/wiki/quick-start)** | ||
- **[Add Command](https://github.com/inhere/php-console/wiki/add-command)** | ||
- **[Add Command Group](https://github.com/inhere/php-console/wiki/add-group)** | ||
- **[Register Command](https://github.com/inhere/php-console/wiki/register-command)** | ||
- **[Error/Exception Capture](https://github.com/inhere/php-console/wiki/error-handle)** | ||
- **[Input Object](https://github.com/inhere/php-console/wiki/input-instance)** | ||
- **[output object](https://github.com/inhere/php-console/wiki/output-instance)** | ||
- **[Formatted Output](https://github.com/inhere/php-console/wiki/format-output)** | ||
- **[Progress Dynamic Output](https://github.com/inhere/php-console/wiki/process-output)** | ||
- **[User Interaction](https://github.com/inhere/php-console/wiki/user-interactive)** | ||
- **[Extension Tools](https://github.com/inhere/php-console/wiki/extra-tools)** | ||
|
||
## Project address | ||
|
||
- **github** https://github.com/inhere/php-console.git | ||
- **gitee** https://gitee.com/inhere/php-console.git | ||
|
||
## Unit test | ||
|
||
```bash | ||
phpunit | ||
// output coverage without xdebug | ||
phpdbg -dauto_globals_jit=Off -qrr /usr/local/bin/phpunit --coverage-text | ||
``` | ||
|
||
## Debuging | ||
|
||
You can set debug level by ENV `CONSOLE_DEBUG=level`, global option `--debug level` | ||
|
||
```bash | ||
# by ENV | ||
$ CONSOLE_DEBUG=4 php examples/app | ||
$ CONSOLE_DEBUG=5 php examples/app | ||
# by global options | ||
$ php examples/app --debug 4 | ||
``` | ||
|
||
## Project use | ||
|
||
Check out these projects, which use https://github.com/inhere/php-console : | ||
|
||
- [kite](https://github.com/inhere/kite) Kite is a tool for help development. | ||
- More, please see [github used by](https://github.com/inhere/php-console/network/dependents?package_id=UGFja2FnZS01NDI5NzMxOTI%3D) | ||
|
||
## License | ||
|
||
[MIT](LICENSE) | ||
|
||
## My projects | ||
|
||
- [inhere/php-validate](https://github.com/inhere/php-validate) A compact and full-featured php verification library | ||
- [inhere/sroute](https://github.com/inhere/php-srouter) Lightweight and fast HTTP request routing library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.