{"id":13792896,"url":"https://github.com/inhere/php-console","last_synced_at":"2025-04-14T22:14:15.666Z","repository":{"id":18331492,"uuid":"84031519","full_name":"inhere/php-console","owner":"inhere","description":"🖥 PHP CLI application library, provide console options,arguments parse, console controller/command run, color style, user interactive, format information show and more.  功能全面的PHP命令行应用库。提供控制台选项、参数解析, 命令运行，颜色风格输出, 用户信息交互, 特殊格式信息显示","archived":false,"fork":false,"pushed_at":"2024-12-05T10:47:45.000Z","size":10926,"stargazers_count":346,"open_issues_count":3,"forks_count":48,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-14T22:14:07.586Z","etag":null,"topics":["cli","cli-flags","command-line","console","console-application","console-color","interactive","phar","php-console"],"latest_commit_sha":null,"homepage":"https://github.com/inhere/php-console/wiki","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inhere.png","metadata":{"files":{"readme":"README.en.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-06T04:57:30.000Z","updated_at":"2025-03-15T13:40:46.000Z","dependencies_parsed_at":"2024-02-07T11:03:50.864Z","dependency_job_id":null,"html_url":"https://github.com/inhere/php-console","commit_stats":{"total_commits":552,"total_committers":9,"mean_commits":"61.333333333333336","dds":0.04347826086956519,"last_synced_commit":"d3a93d8d0b418e0cc3a5f951c4b190d332338278"},"previous_names":[],"tags_count":76,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inhere%2Fphp-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inhere%2Fphp-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inhere%2Fphp-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inhere%2Fphp-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inhere","download_url":"https://codeload.github.com/inhere/php-console/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968917,"owners_count":21191162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cli-flags","command-line","console","console-application","console-color","interactive","phar","php-console"],"created_at":"2024-08-03T22:01:17.554Z","updated_at":"2025-04-14T22:14:15.647Z","avatar_url":"https://github.com/inhere.png","language":"PHP","readme":"# PHP Console\n\n[![License](https://img.shields.io/packagist/l/inhere/console.svg?style=flat-square)](LICENSE)\n[![Php Version](https://img.shields.io/badge/php-%3E=8.0-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/inhere/console)\n[![Latest Stable Version](http://img.shields.io/packagist/v/inhere/console.svg)](https://packagist.org/packages/inhere/console)\n[![Github Actions Status](https://github.com/inhere/php-console/workflows/Unit-tests/badge.svg)](https://github.com/inhere/php-console/actions)\n[![zh-CN readme](https://img.shields.io/badge/Readme-中文-brightgreen.svg?maxAge=2592000)](README.md)\n\nFull-featured php command line application library. \n\nProvide console parameter parsing, command run, color style output, user information interaction, and special format information display.\n\n\u003e NOTICE: Current version **v4.1+**, require **PHP 8.0+**\n\n## Command line preview\n\n![app-command-list](https://raw.githubusercontent.com/inhere/php-console/3.x/docs/screenshots/app-command-list.png)\n\n## Features\n\n\u003e Easy to use. Can be easily integrated into any existing project.\n\n- Command line application, `controller`, `command` parsing run on the command line\n- Support for setting aliases for commands. A command can have multiple aliases. \n- Support command display/hide, enable/disable.\n- Full-featured command line option parameter parsing (named parameters, short options `-s`, long options `--long`). \n- The `input`, `output` of the command line, management, use\n- Command method comments are automatically parsed as help information (by default, `@usage` `@arguments` `@options` `@example`)\n- Support for outputting message texts of multiple color styles (`info`, `comment`, `success`, `warning`, `danger`, `error` ... )\n- Commonly used special format information display (`section`, `panel`, `padding`, `helpPanel`, `table`, `tree`, `title`, `list`, `multiList`)\n- Rich dynamic information display (`pending/loading`, `pointing`, `spinner`, `counterTxt`, `dynamicText`, `progressTxt`, `progressBar`)\n- Common user information interaction support (`select`, `multiSelect`, `confirm`, `ask/question`, `askPassword/askHiddenInput`)\n- Support for predefined parameter definitions like `symfony/console` (giving parameter values by position, recommended when strict parameter restrictions are required)\n- The color output is `windows` `linux` `mac` compatible. Environments that do not support color will automatically remove the relevant CODE.\n- Quickly generate auto-completion scripts for the current application in the `bash/zsh` environment\n- NEW: Support start an interactive shell for run application\n\n### Built-in tools\n\n- Built-in Phar packaging tool class, which can be easily packaged into `phar` files. Easy to distribute and use\n  - Run the command `php examples/app phar:pack` in the example, which will package this console library into an `app.phar`\n- Built-in file download tool class under command line with progress bar display\n- Command line php code highlighting support (from `jakub-onderka/php-console-highlighter` and making some adjustments)\n- Simple Terminal screen, cursor control operation class\n- Simple process operations using classes (fork, run, stop, wait ..., etc.)\n\n\u003e All features, effects; can be run in the example code `phps/app` in `examples/`. Basically covers all the features and can be tested directly\n\n## Installation\n\n- Requirement PHP 8.0+\n\n```bash\ncomposer require inhere/console\n```\n\n## Document List\n\n\u003e Please go to WIKI for detailed usage documentation\n\n- **[Document Home](https://github.com/inhere/php-console/wiki/home)**\n- **[Feature Overview](https://github.com/inhere/php-console/wiki/overview)**\n- **[Install](https://github.com/inhere/php-console/wiki/install)**\n- **[Create Application](https://github.com/inhere/php-console/wiki/quick-start)**\n- **[Add Command](https://github.com/inhere/php-console/wiki/add-command)**\n- **[Add Command Group](https://github.com/inhere/php-console/wiki/add-group)**\n- **[Register Command](https://github.com/inhere/php-console/wiki/register-command)**\n- **[Error/Exception Capture](https://github.com/inhere/php-console/wiki/error-handle)**\n- **[Input Object](https://github.com/inhere/php-console/wiki/input-instance)**\n- **[output object](https://github.com/inhere/php-console/wiki/output-instance)**\n- **[Formatted Output](https://github.com/inhere/php-console/wiki/format-output)**\n- **[Progress Dynamic Output](https://github.com/inhere/php-console/wiki/process-output)**\n- **[User Interaction](https://github.com/inhere/php-console/wiki/user-interactive)**\n- **[Extension Tools](https://github.com/inhere/php-console/wiki/extra-tools)**\n\n## Project address\n\n- **github** https://github.com/inhere/php-console.git\n- **gitee** https://gitee.com/inhere/php-console.git\n\n## Unit test\n\n```bash\nphpunit\n// output coverage without xdebug\nphpdbg -dauto_globals_jit=Off -qrr /usr/local/bin/phpunit --coverage-text\n```\n\n## Debuging\n\nYou can set debug level by ENV `CONSOLE_DEBUG=level`, global option `--debug level`\n\n```bash\n# by ENV\n$ CONSOLE_DEBUG=4 php examples/app\n$ CONSOLE_DEBUG=5 php examples/app\n# by global options\n$ php examples/app --debug 4\n```\n\n## Project use\n\nCheck out these projects, which use https://github.com/inhere/php-console :\n\n- [kite](https://github.com/inhere/kite) Kite is a tool for help development.\n- More, please see [github used by](https://github.com/inhere/php-console/network/dependents?package_id=UGFja2FnZS01NDI5NzMxOTI%3D)\n\n## License\n\n[MIT](LICENSE)\n\n## My projects\n\n- [inhere/php-validate](https://github.com/inhere/php-validate) A compact and full-featured php verification library\n- [inhere/sroute](https://github.com/inhere/php-srouter) Lightweight and fast HTTP request routing library\n","funding_links":[],"categories":["PHP","类库"],"sub_categories":["CLI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finhere%2Fphp-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finhere%2Fphp-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finhere%2Fphp-console/lists"}