fiberphp/console

FiberPHP console: self-built CLI application with input/output parsing, command dispatch, server control and interactive helpers.

Maintainers

Package info

gitee.com/FiberPHP/console

Issues

pkg:composer/fiberphp/console

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

dev-master 2026-08-22 10:49 UTC

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|connectionsconfig:cache|clearoptimize:cache|clearpackage:discoverversion
  • 命令发现:内置目录扫描 + 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();

命令优先级

后注册者按命令名覆盖前者:

  1. PackageManifest::commands()(包发现 + config/command/*.php 扫描)
  2. config('commands') 应用显式声明

License

MIT