PHPackages                             tdtrung17693/php-chalk - 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. tdtrung17693/php-chalk

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

tdtrung17693/php-chalk
======================

Just another PHP terminal string styling library

v1.0.0(6y ago)11252↓100%2Apache-2PHP

Since Jun 11Pushed 4y ago1 watchersCompare

[ Source](https://github.com/tdtrung17693/php-chalk)[ Packagist](https://packagist.org/packages/tdtrung17693/php-chalk)[ RSS](/packages/tdtrung17693-php-chalk/feed)WikiDiscussions master Synced 1mo ago

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

PHP Chalk
=========

[](#php-chalk)

A PHP terminal styling library inspired by [Chalk](https://github.com/chalk/chalk)

Features
--------

[](#features)

- Support 16 colors, 256 colors and Truecolor (16m colors) mode.
- Support style chaining.
- Support style nesting.

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

[](#installation)

**Through composer**

```
composer require tdtrung17693/php-chalk

```

**Manually**:

Just download/clone this repo

Usage
-----

[](#usage)

See `examples` to know more about how to use this library.

```
print $chalk->bold->green("Bold Green");
print "\n";
print $chalk->underscore->color220->bgColor20("Blink Foreground 220 Background 20");
print "\n";
print $chalk->rgb(200, 20, 100)->inverse("Inverse");

// Style nesting
print $chalk->red("Red then", $chalk->bold->green("bold and green then"), $chalk->reset("back to normal\n"));
```

**Screenshot**:

[![Examples](img/examples.png)](img/examples.png)

[![Color blocks](img/screenshot.png)](img/screenshot.png)

API
---

[](#api)

### **`$chalk->[->...](string, [string...])`**

[](#chalk-style-stylestring-string)

*Example*: `$chalk->bgGreen->red->bold('Background green red bold text')`

### **`$chalk->hasColorSupport(), $chalk->has256Support(), $chalk->has16mSupport()`**

[](#chalk-hascolorsupport-chalk-has256support-chalk-has16msupport)

Return true if the corresponding feature is supported.

Styles supported
----------------

[](#styles-supported)

- `reset`, `bold`, `dim`, `underscore`, `italic`, `strikethrough`, `blink`.
- `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`
- `lightGray`, `darkGray`, `lightRed`, `lightGreen`, `lightYellow`, `lightBlue`, `lightMagenta`, `lightCyan`
- Each of the color styles above with the prefix `bg`

Contribute
----------

[](#contribute)

Feel free to contribute by forking or making suggestions.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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

2523d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9eee7a3ccbc1695c7fad96779c56ffe30a5cf53bed00aae23564dcc4aecea301?d=identicon)[tdtrung17693](/maintainers/tdtrung17693)

---

Top Contributors

[![tdtrung17693](https://avatars.githubusercontent.com/u/3716206?v=4)](https://github.com/tdtrung17693 "tdtrung17693 (3 commits)")[![aelliott1485](https://avatars.githubusercontent.com/u/7459390?v=4)](https://github.com/aelliott1485 "aelliott1485 (1 commits)")

---

Tags

ansiansi-codeansi-coloransi-colorsclicli-colorcli-stylephpstyleclicolorcli-colorterminal coloransi color

### Embed Badge

![Health badge](/badges/tdtrung17693-php-chalk/health.svg)

```
[![Health](https://phpackages.com/badges/tdtrung17693-php-chalk/health.svg)](https://phpackages.com/packages/tdtrung17693-php-chalk)
```

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B11.2k](/packages/symfony-console)[nunomaduro/collision

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

4.6k331.8M8.4k](/packages/nunomaduro-collision)[nunomaduro/termwind

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

2.5k239.8M280](/packages/nunomaduro-termwind)[kevinlebrun/colors.php

Colors for PHP CLI scripts

3426.7M44](/packages/kevinlebrun-colorsphp)[wp-cli/php-cli-tools

Console utilities for PHP

68325.0M364](/packages/wp-cli-php-cli-tools)[adhocore/cli

Command line interface library for PHP

3501.2M50](/packages/adhocore-cli)

PHPackages © 2026

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