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

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

nvan/cli-plus
=============

CLI Plus is a PHP little library to add colors and effects to CLI apps

v1.0.0(3y ago)05MITPHPPHP &gt;=8.1

Since Oct 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/nvan/cli-plus)[ Packagist](https://packagist.org/packages/nvan/cli-plus)[ Docs](https://github.com/nvan/cli-plus)[ Fund](https://paypal.me/maduranma)[ RSS](/packages/nvan-cli-plus/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

CLI Plus
--------

[](#cli-plus)

CLI Plus is a little PHP library that allows you to set colors and format to the text that's being output to the Terminal / Command Line.

This is useful if you make apps that run on Command Line and you want to make them look nicer.

It's based on the idea of how the console is used in C# or other languages.

How to use
----------

[](#how-to-use)

First of all import the library via composer:

```
composer require nvan/cli-plus
```

Once you have installed the library:

```
use nvan\CliPlus\Console;
Console::writeLine('Hello world!');
Console::write('This is on the next line!');
Console::write('But this is not!');
```

You can apply foreground (text) color, and background color doing:

```
use nvan\CliPlus\Colors;
Console::setForegroundColor(Colors::White);
Console::setBackgroundColor(Colors::Red);
Console::write('This text is white with red background!');
```

And to apply styles do:

```
use nvan\CliPlus\Formats;
Console::setFormat(Formats::Bold);
Console::write('This text is bold!');
```

Formats and colors lists with examples are available at: [https://misc.flogisoft.com/bash/tip\_colors\_and\_formatting](https://misc.flogisoft.com/bash/tip_colors_and_formatting)

Future updates
--------------

[](#future-updates)

I'm planning to add some kind of user input processing, kind of nextInt, nextX(type) from Java.

Also, I want to implement some features like reading passwords while the text is hidden (a little linux-style), even tough this can be done, but not as simple as it'll be with next updates, by doing something like:

```
Console::write('Enter your password: ');
Console::addFormat(Formats::Hidden);
Console::write();
$pass = readline();
Console::removeFormat(Formats::Hidden);

if($pass === '12345') {
    Console::setForegroundColor(Colors::LightGreen);
    Console::writeLine('Password is correct! Welcome!');
}
```

Donations
---------

[](#donations)

If you use and like this library, consider buying me a 🍺 beer.

You can donate via **PayPal**:

[![paypal](https://camo.githubusercontent.com/e1ff554a09e8e92bef25abc553ff05b88f45afd695877cf12f3a46558ef65b2e/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e61746543435f4c472e676966)](https://paypal.me/maduranma)

License
-------

[](#license)

MIT

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

1315d ago

### Community

Maintainers

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

---

Top Contributors

[![maduranma](https://avatars.githubusercontent.com/u/4058702?v=4)](https://github.com/maduranma "maduranma (1 commits)")

### Embed Badge

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

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

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

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

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[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)[codedungeon/php-cli-colors

Liven up you PHP Console Apps with standard colors

10210.1M26](/packages/codedungeon-php-cli-colors)

PHPackages © 2026

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