PHPackages                             danieljharvey/php-cli-colours - 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. danieljharvey/php-cli-colours

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

danieljharvey/php-cli-colours
=============================

A small library for using colours in CLI scripts

1.2.0(8y ago)01.0k↓100%MITPHP

Since Apr 10Pushed 8y agoCompare

[ Source](https://github.com/danieljharvey/php-cli-colours)[ Packagist](https://packagist.org/packages/danieljharvey/php-cli-colours)[ RSS](/packages/danieljharvey-php-cli-colours/feed)WikiDiscussions master Synced today

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

php-cli-colours
===============

[](#php-cli-colours)

I like my CLI scripts to be colourful and with this library I hope to achieve said colours

Example usage

```
include 'BashColours.php';
$bashColours=new \DanielJHarvey\CLIColours\BashColours();

echo "I am writing a nice CLI script and ".$bashColours->formatString("BANG!", 'red')." I need exciting things to happen\n";

echo $bashColours->formatString("But now everything is fine and stuff",'default','green');

```

Or now you can change forecolor with a big heap of shortcut functions:

```
include 'BashColours.php';
$colour=new \DanielJHarvey\CLIColours\BashColours();

echo $colour->red("red")." and ".$colour->yellow("yellow")." and ".$colour->lightMagenta("pink")." and ".$colour->green("green")."...\n";

```

The full set of foreground and background colors from this list are implemented:

[http://misc.flogisoft.com/bash/tip\_colors\_and\_formatting](http://misc.flogisoft.com/bash/tip_colors_and_formatting)

Will consider adding bold/italic/blink etc later.

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

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

Total

2

Last Release

3242d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/93fbc523207f38cbe06a394df6770ff393426bd24237e82c477da30e1b673af1?d=identicon)[danieljharvey](/maintainers/danieljharvey)

---

Top Contributors

[![danieljharvey](https://avatars.githubusercontent.com/u/4729125?v=4)](https://github.com/danieljharvey "danieljharvey (13 commits)")

---

Tags

bashcoloursphp

### Embed Badge

![Health badge](/badges/danieljharvey-php-cli-colours/health.svg)

```
[![Health](https://phpackages.com/badges/danieljharvey-php-cli-colours/health.svg)](https://phpackages.com/packages/danieljharvey-php-cli-colours)
```

###  Alternatives

[nunomaduro/collision

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

4.6k324.1M7.1k](/packages/nunomaduro-collision)[wp-cli/wp-cli

WP-CLI framework

5.1k16.6M259](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22568.5M16](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26946.8M4](/packages/chi-teck-drupal-code-generator)[consolidation/config

Provide configuration services for a commandline tool.

16959.8M14](/packages/consolidation-config)[seld/cli-prompt

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

24725.5M15](/packages/seld-cli-prompt)

PHPackages © 2026

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