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)08MITPHPPHP &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 today

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 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

1361d 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

[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71470.5k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20720.9k21](/packages/winbox-args)[tomatophp/filament-artisan

Simple but yet powerful library for running some artisan commands for FilamentPHP

3275.4k1](/packages/tomatophp-filament-artisan)[thettler/laravel-console-toolkit

This Package provides some usefully console features like the attribute syntax for arguments and options, validation, auto ask and casting.

324.1k](/packages/thettler-laravel-console-toolkit)

PHPackages © 2026

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