PHPackages                             switon/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. switon/cli

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

switon/cli
==========

Command surface with discovery, option binding, help output, and shell completion for Switon Framework

v1.0.0(1mo ago)0134MITPHPPHP &gt;=8.3CI passing

Since Jun 6Pushed 1mo agoCompare

[ Source](https://github.com/switon-php/cli)[ Packagist](https://packagist.org/packages/switon/cli)[ Docs](https://github.com/switon-php/cli)[ RSS](/packages/switon-cli/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (12)Versions (2)Used By (4)

Switon CLI Package
==================

[](#switon-cli-package)

[![CI](https://camo.githubusercontent.com/664fddeeab4e8fd21d596491bef3b5c0356563d7c9bc3b626740f6d195d415c8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737769746f6e2d7068702f636c692f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d4349)](https://github.com/switon-php/cli/actions/workflows/ci.yml) [![PHP 8.3+](https://camo.githubusercontent.com/c03f51341eebaefabbf137e291b20523fc74b4ffd084406d88524d266d95085d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d373737424234)](https://www.php.net/)

Switon's CLI runtime for auto-discovered commands, help, and shell completion.

Highlights
----------

[](#highlights)

- **Auto-discovered commands:** package and app commands appear without manual registration.
- **Multi-action commands:** one command can expose several actions with shared help.
- **Automatic options:** action parameters become long options by default, with `#[ShortOption]` for short aliases.
- **Inline help text:** command help stays close to the code.
- **Shell completion:** the same command metadata feeds bash and zsh completion.

Installation
------------

[](#installation)

```
composer require switon/cli
```

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

[](#quick-start)

```
use Switon\Core\Attribute\Autowired;
use Switon\Core\ConsoleInterface;

/**
 * Send a greeting.
 */
class GreetCommand
{
    #[Autowired] protected ConsoleInterface $console;

    /**
     * Say hello to one user.
     *
     * @param string $name Recipient name.
     * @param bool $shout Uppercase the message.
     */
    public function helloAction(string $name = 'world', bool $shout = false): void
    {
        $message = $shout ? 'HELLO, {name}!' : 'Hello, {name}!';
        $this->console->success($message, ['name' => $name]);
    }
}
```

```
bash bin/console greet:hello --name=world --shout
```

Docs:

License
-------

[](#license)

MIT.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance90

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc0f20ad15b0ae9fbf9c6e2cd3008692b0c88a877ec8d3e0119211314bf86fc8?d=identicon)[switon](/maintainers/switon)

---

Top Contributors

[![switon-php](https://avatars.githubusercontent.com/u/247358032?v=4)](https://github.com/switon-php "switon-php (1 commits)")

---

Tags

clicommandsconsoleswitoncliconsolecommandsswiton

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/switon-cli/health.svg)

```
[![Health](https://phpackages.com/badges/switon-cli/health.svg)](https://phpackages.com/packages/switon-cli)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M425](/packages/drupal-core-recommended)[buggregator/trap

A simple and powerful tool for debugging PHP applications.

2702.2M69](/packages/buggregator-trap)[testo/testo

A lightweight PHP testing framework.

1959.3k116](/packages/testo-testo)[aplus/cli

Aplus Framework CLI Library

2351.7M6](/packages/aplus-cli)[laminas/laminas-cli

Command-line interface for Laminas projects

564.1M74](/packages/laminas-laminas-cli)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
