承接 duon/cli 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

duon/cli

最新稳定版本:0.1.2

Composer 安装命令:

composer require duon/cli

包简介

Duon cli tools/runner

关键字:

README 文档

README

Software License Codacy Badge Codacy Badge Psalm coverage Psalm level

A command line interface helper like Laravel's Artisan with way less magic.

Features

  • Simple command creation with automatic help generation
  • Built-in color support for terminal output
  • Command-specific help with php run help <command>
  • Built-in commands command for shell autocomplete
  • Support for --key=value and --key value option syntax
  • Output helpers: info(), success(), warn(), error(), echoln()
  • Text indentation and wrapping with indent()
  • Debug mode for detailed error traces
  • 100% test coverage

Installation

composer require duon/cli

Quick Start

Create a command by extending Duon\Cli\Command:

use Duon\Cli\Command;

class MyCommand extends Command {
    protected string $name = 'mycommand';
    protected string $group = 'MyGroup';
    protected string $description = 'This is my command';

    public function run(): int
    {
        $this->info("Running my command");
        $this->success("Command completed!");
        return 0;
    }
}

Create a runner script:

<?php
require __DIR__ . '/vendor/autoload.php';

use Duon\Cli\{Runner, Commands};

$commands = new Commands([new MyCommand()]);
$runner = new Runner($commands);
$runner->run();

Run your command:

$ php run mycommand
Running my command
Command completed!

License

This project is licensed under the MIT license.

统计信息

  • 总下载量: 311
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固