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(9y ago)01.0kMITPHP

Since Apr 10Pushed 9y 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 2w ago

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

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

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

3334d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4729125?v=4)[Daniel Harvey](/maintainers/danieljharvey)[@danieljharvey](https://github.com/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

[seld/cli-prompt

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

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.2k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

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

Windows command-line formatter

20718.9k21](/packages/winbox-args)

PHPackages © 2026

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