PHPackages                             duon/cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. duon/cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

duon/cli
========

Duon cli tools/runner

0.1.1(3mo ago)01832MITPHPPHP ^8.5CI passing

Since Jan 28Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/duonrun/cli)[ Packagist](https://packagist.org/packages/duon/cli)[ Docs](https://duon.dev/boiler)[ RSS](/packages/duon-cli/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (2)

Duon Cli
========

[](#duon-cli)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![Codacy Badge](https://camo.githubusercontent.com/87a87c519fd28c9cf477952aedec1acb6d138fcd5573e2fb53ac249e75a69f97/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3462333363303437383162303432303962396431663864353066356633633161)](https://app.codacy.com/gh/duonrun/cli/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Codacy Badge](https://camo.githubusercontent.com/8f48c438cb9738cff5290d4231e82a3abf2552ff2492779a7db5aaae726c7692/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3462333363303437383162303432303962396431663864353066356633633161)](https://app.codacy.com/gh/duonrun/cli/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)[![Psalm coverage](https://camo.githubusercontent.com/5f03bc0cf7bc1d81507297cb655a4f63a8b865fbb61e709f2314e0491a2ee111/68747470733a2f2f73686570686572642e6465762f6769746875622f64756f6e72756e2f636c692f636f7665726167652e7376673f)](https://shepherd.dev/github/duonrun/cli)[![Psalm level](https://camo.githubusercontent.com/aff2e64d57bee82f0b2e88bdc0fa4602a9fc2bfef4d64d981896f06cff624f29/68747470733a2f2f73686570686572642e6465762f6769746875622f64756f6e72756e2f636c692f6c6576656c2e7376673f)](https://duon.sh/cli)

A command line interface helper like [Laravel's Artisan](https://laravel.com/docs/9.x/artisan) with way less magic.

Features
--------

[](#features)

- Simple command creation with automatic help generation
- Built-in color support for terminal output
- Command-specific help with `php run help `
- 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
------------

[](#installation)

```
composer require duon/cli
```

Quick Start
-----------

[](#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:

```
