fiberphp / console
FiberPHP console: self-built CLI application with input/output parsing, command dispatch, server control and interactive helpers.
dev-master
2026-08-22 10:49 UTC
Requires
- php: >=8.3
- fiberphp/framework: dev-master
Requires (Dev)
- phpunit/phpunit: ^11.0
This package is not auto-updated.
Last update: 2026-08-22 10:50:17 UTC
README
自研 CLI 应用(不依赖 Symfony Console),提供命令解析、分发、交互式输入输出与服务器控制。
特性
- 自研 Input/Output 解析(Argument / Option / Definition)
- 彩色输出格式化(Formatter / FormatterStyle)与表格渲染
- 交互式问答(Ask / ConfirmationQuestion / Question)
- 内置命令:
server:start|stop|reload|restart|status|connections、config:cache|clear、optimize:cache|clear、package:discover、version - 命令发现:内置目录扫描 +
PackageManifest::commands()+config('commands')显式声明
安装
composer require fiberphp/console
入口
在项目根目录创建 fiberphp 命令脚本:
#!/usr/bin/env php
<?php
declare(strict_types=1);
use FiberPHP\Console\Application;
const BASE_PATH = __DIR__;
require_once __DIR__ . '/vendor/autoload.php';
Application::start();
命令优先级
后注册者按命令名覆盖前者:
PackageManifest::commands()(包发现 +config/command/*.php扫描)config('commands')应用显式声明
License
MIT