PHPackages                             xy2z/cliclass - 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. xy2z/cliclass

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

xy2z/cliclass
=============

Create a simple CLI tool from a PHP class

3.0.0(6y ago)26[3 issues](https://github.com/xy2z/CliClass/issues)[1 PRs](https://github.com/xy2z/CliClass/pulls)MITPHP

Since Oct 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/xy2z/CliClass)[ Packagist](https://packagist.org/packages/xy2z/cliclass)[ RSS](/packages/xy2z-cliclass/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (9)Used By (0)

CliClass
========

[](#cliclass)

(previously known as SlimConsole)

Create a simple CLI tool from a PHP class.

- All public methods will be available to run from cli.
- PHPdocs will be displayed as the description.
- Method arguments are automatically validated.
- Supports multiple classes.

Requires
--------

[](#requires)

- PHP 7.0 or above

Install
-------

[](#install)

`composer require xy2z/cliclass`

Usage
-----

[](#usage)

```
require '/path/to/vendor/autoload.php';

use xy2z\CliClass\CliClass;

class Router {
	/**
	 * Says hello world.
	 */
	public function hello_world() {
		echo 'Hello world.';
	}

	/**
	 * Says hello to $name.
	 */
	public function hello(string $name) {
		echo 'Hello ' . $name;
	}
}

CliClass::init($argv, [
	Router::class,
]);
```

### Result

[](#result)

```
$ php cli.php
Usage:
 command [arguments]

Available commands:
 hello_world  Says hello world.
 hello         Says hello to $name.
```

```
$ php cli.php hello_world
Hello world.
```

```
$ php cli.php hello
Usage: hello
Error: Missing argument 2 for $name (no default value)
```

```
$ php cli.php hello Peter
Hello Peter
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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

Every ~87 days

Recently: every ~130 days

Total

7

Last Release

2240d ago

Major Versions

1.0.4 → 2.0.02019-10-23

2.0.0 → 3.0.02020-03-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d4c08a97e1c9c53efb123c306f551fcb367e8adea3bfa1412c49c8e5133aeff?d=identicon)[xy2z](/maintainers/xy2z)

---

Top Contributors

[![xy2z](https://avatars.githubusercontent.com/u/4496997?v=4)](https://github.com/xy2z "xy2z (15 commits)")

---

Tags

clicli-frameworkphp

### Embed Badge

![Health badge](/badges/xy2z-cliclass/health.svg)

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

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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