PHPackages                             matks/vivian - 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. matks/vivian

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

matks/vivian
============

Php tools to provide a pretty console output

v2.0(11y ago)1435[1 issues](https://github.com/matks/Vivian/issues)1MITPHPPHP &gt;=5.3.3

Since Oct 13Pushed 9y ago2 watchersCompare

[ Source](https://github.com/matks/Vivian)[ Packagist](https://packagist.org/packages/matks/vivian)[ Docs](https://github.com/matks/Vivian)[ RSS](/packages/matks-vivian/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (5)Used By (1)

Vivian
======

[](#vivian)

[![Latest Stable Version](https://camo.githubusercontent.com/b8b8ef7acaacc105fd1ea25989f11c8febf1cd838b0b43473f38c71e092a66ff/68747470733a2f2f706f7365722e707567782e6f72672f6d61746b732f76697669616e2f762f737461626c652e737667)](https://packagist.org/packages/matks/vivian)[![Build Status](https://camo.githubusercontent.com/4f926d2cf9b52f98645dc5248544d28ef670fd99206150c29de67079b854abf6/68747470733a2f2f7472617669732d63692e6f72672f6d61746b732f56697669616e2e706e67)](https://travis-ci.org/matks/Vivian)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4a92c7365361e4c4fb63d2e2768f718540d4309fddcedffd45cdacd91b9f0044/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d61746b732f56697669616e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/matks/Vivian/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/95d3d38d51071c743ad609b636297ee26900fe4bc183c11a78a5f4c655db2ed7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d61746b732f56697669616e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/matks/Vivian/?branch=master)[![Latest Unstable Version](https://camo.githubusercontent.com/18d72065d1bef003a743f75ebacd64608bdfd6f1584fd27fcdd4a9e1cf6142fa/68747470733a2f2f706f7365722e707567782e6f72672f6d61746b732f76697669616e2f762f756e737461626c652e737667)](https://packagist.org/packages/matks/vivian)[![License](https://camo.githubusercontent.com/a799268a1a2f70ae417b5fb80923626eee35e5c86d16a87f5d87e1e5ef399a83/68747470733a2f2f706f7365722e707567782e6f72672f6d61746b732f76697669616e2f6c6963656e73652e737667)](https://packagist.org/packages/matks/vivian)

Tools to provide a pretty console output in ANSI/VT100 terminals

[![](https://cloud.githubusercontent.com/assets/3830050/5061655/3202b658-6da0-11e4-8211-dce2fef12fc6.png)](https://cloud.githubusercontent.com/assets/3830050/5061655/3202b658-6da0-11e4-8211-dce2fef12fc6.png)

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

[](#installation)

Install the dependencies with composer

```
composer install
```

Tests
-----

[](#tests)

Install the dev dependencies with composer

```
composer install --dev
```

Run the unit tests suite with atoum binary.

```
vendor/bin/atoum -bf vendor/autoload.php -d tests/Units/
```

Usage
-----

[](#usage)

### Tool

[](#tool)

For simple styles, the class Matks\\Vivian\\Tools provide a useful call interface, for example:

```
use Matks\Vivian\Tools as Output;

echo Output::bold('... done.') . PHP_EOL;

if ($success) {
	echo Output::green('Success');
	echo PHP_EOL;
} else {
	echo Output::red('Failure !');
	echo PHP_EOL;
	echo Output::s_list1($errors);
}
```

See the examples in tests/Console:

```
php tests/Console/test-color
php tests/Console/test-background-color
php tests/Console/test-style
php tests/Console/test-border
php tests/Console/test-mixed
php tests/Console/test-structure
php tests/Console/test-figlet
```

or

```
bash tests/Console/test-all.sh
```

### Elements

[](#elements)

For advanced displays, build the Elements you need:

#### Text Element

[](#text-element)

```
use Matks\Vivian\Color;
use Matks\Vivian\Style;
use Matks\Vivian\Output;

$textElement = new Output\TextElement('Hello world !');

$boldStyle             = new Style\Style(Style\StyleManager::BASH_BOLD);
$greenColor            = new Color\TextColor(Color\TextColorManager::BASH_FOREGROUND_GREEN);
$cyanBackgroundColor   = new Color\BackgroundColor(Color\BackgroundColorManager::BASH_BACKGROUND_CYAN);

$textElement->setTextColor($greenColor)
            ->setBackgroundColor($cyanBackgroundColor)
            ->addStyle($boldStyle)
;

echo $textElement->render();
```

#### Bordered Element

[](#bordered-element)

```
use Matks\Vivian\Border;
use Matks\Vivian\Color;
use Matks\Vivian\Output;

$yellowColor = new Color\TextColor(Color\TextColorManager::BASH_FOREGROUND_YELLOW);
$border      = new Border\Border(Border\Border::TYPE_FRAME);

$borderedElement = new Output\BorderedElement('Hello world !', $border);
$borderedElement->setTextColor($yellowColor);

echo $borderedElement->render();
```

#### Structured Elements

[](#structured-elements)

```
use Matks\Vivian\Color;
use Matks\Vivian\Output;
use Matks\Vivian\Style;
use Matks\Vivian\Structure;

$greenColor     = new Color\TextColor(Color\TextColorManager::BASH_FOREGROUND_GREEN);
$redColor       = new Color\TextColor(Color\TextColorManager::BASH_FOREGROUND_RED);
$blinkingStyle  = new Style\Style(Style\StyleManager::BASH_BLINK);

$textElement1 = new Output\TextElement('Hello');
$textElement2 = new Output\TextElement('world');
$textElement3 = new Output\TextElement('!');
$textElement1->setTextColor($greenColor);
$textElement2->setTextColor($redColor);
$textElement3->addStyle($blinkingStyle);

$elements = array(
    $textElement1,
    $textElement2,
    $textElement3
);

$structure  = new Structure\Structure(Structure\Structure::TYPE_LIST, '#', '  ');
$structuredElements = new Output\StructuredElements($elements, $structure);
echo $structuredElements->render();
```

More about ANSI/VT100 terminal control
--------------------------------------

[](#more-about-ansivt100-terminal-control)

License
-------

[](#license)

Vivian is licensed under the MIT License - see the LICENSE file for details

More advanced features
----------------------

[](#more-advanced-features)

I found a far more efficient library doing the same purpose: [CLImate](https://github.com/thephpleague/climate). I recommend it.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

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 ~10 days

Total

4

Last Release

4251d ago

Major Versions

v1.2 → v2.02014-11-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3830050?v=4)[Mathieu Ferment](/maintainers/matks)[@matks](https://github.com/matks)

---

Top Contributors

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

---

Tags

consolephpconsole

### Embed Badge

![Health badge](/badges/matks-vivian/health.svg)

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

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B13.9k](/packages/symfony-console)[psy/psysh

An interactive shell for modern PHP.

9.8k582.3M821](/packages/psy-psysh)[nunomaduro/collision

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

4.7k357.7M11.1k](/packages/nunomaduro-collision)[nunomaduro/termwind

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

2.5k271.5M386](/packages/nunomaduro-termwind)[nunomaduro/phpinsights

Instant PHP quality checks from your console.

5.6k11.7M494](/packages/nunomaduro-phpinsights)[wp-cli/php-cli-tools

Console utilities for PHP

68227.8M374](/packages/wp-cli-php-cli-tools)

PHPackages © 2026

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