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.0k↓100%MITPHP

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 1mo 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

30

—

LowBetter than 64% 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

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

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M318](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M18](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[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)

PHPackages © 2026

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