PHPackages                             yanghuxiao/phpcli - 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. yanghuxiao/phpcli

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

yanghuxiao/phpcli
=================

The lightest PHP CLI helper classes

v0.0.2(8y ago)1121MITPHPPHP &gt;=5.4

Since Jul 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/yanghuxiao/PHPCli)[ Packagist](https://packagist.org/packages/yanghuxiao/phpcli)[ Docs](https://github.com/yanghuxiao/PHPCli)[ RSS](/packages/yanghuxiao-phpcli/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

PHPCli
======

[](#phpcli)

The lightest PHP CLI helper classes

Requirement
-----------

[](#requirement)

PHP 5.4+

Get Started
-----------

[](#get-started)

### Install via composer

[](#install-via-composer)

Add PHPCli to composer.json configuration file.

```
$ composer require yanghuxiao/PHPCli

```

And update the composer

```
$ composer update

```

```
// If you installed via composer, just use this code to requrie autoloader on the top of your projects.
require 'vendor/autoload.php';

// Using Medoo namespace
use PHPCli\PHPCli;

// Initialize
PHPCli::init();

// Gets a single command-line option. Returns TRUE if the option exists, but doesn't have a value, and is simply acting as a flag.
PHPCli::getOption('a');

// Enter a number of empty lines
PHPCli::newLine(2);

// Outputs a string to the cli.
PHPCli::write('PHPCli','green','yellow');

// Clears the screen of output
PHPCli::clearScreen();

// Waits a certain number of seconds, optionally showing a wait message and waiting for a key press.
PHPCli::wait(3);

// Outputs an error to the CLI using STDERR instead of STDOUT
PHPCli::error('error.....');

// Asks the user for input.  This can have either 1 or 2 arguments.
PHPCli::prompt();
$color = PHPCli::prompt('What is your favorite color?');
$color = PHPCli::prompt('What is your favourite color?', 'white');
$ready = PHPCli::prompt('Are you ready?', array('y','n'));

// Displays a progress bar on the CLI. You must call it repeatedly to update it. Set $thisStep = false to erase the progress bar.
for ($i=0; $i < 100; $i++) {
	PHPCli::showProgress($i,100);
	sleep(1);
}
```

License
-------

[](#license)

PHPCli is under the MIT license.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

Every ~0 days

Total

2

Last Release

3228d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/61a56ddc4ebca39222a960e5e7ccbf5f541595ec3921ff9473d890da99c4331a?d=identicon)[desdev](/maintainers/desdev)

---

Top Contributors

[![DesDevTech](https://avatars.githubusercontent.com/u/2083922?v=4)](https://github.com/DesDevTech "DesDevTech (5 commits)")

---

Tags

clireadline

### Embed Badge

![Health badge](/badges/yanghuxiao-phpcli/health.svg)

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

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B11.3k](/packages/symfony-console)[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.5k](/packages/nunomaduro-collision)[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k239.8M286](/packages/nunomaduro-termwind)[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[clue/stdio-react

Async, event-driven console input &amp; output (STDIN, STDOUT) for truly interactive CLI applications, built on top of ReactPHP

19810.2M27](/packages/clue-stdio-react)[wp-cli/php-cli-tools

Console utilities for PHP

68325.0M367](/packages/wp-cli-php-cli-tools)

PHPackages © 2026

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