PHPackages                             bvanhoekelen/terminal-style - 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. bvanhoekelen/terminal-style

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

bvanhoekelen/terminal-style
===========================

Return your terminal message in style! Change the text style, text color and text background color form the terminal interface with ANSI color codes. The terminal style tool support Laravel and Composer.

v1.0.5(6y ago)19784.4k↑23.9%10[1 PRs](https://github.com/bvanhoekelen/terminal-style/pulls)2Apache-2.0PHPPHP &gt;=5.4.0CI failing

Since Apr 20Pushed 6y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (2)Versions (8)Used By (2)

PHP Terminal style
==================

[](#php-terminal-style)

[![Hex.pm](https://camo.githubusercontent.com/deba58212918eeb974a7659ab52917cf517a949f1bb99bce9bed6c74a02adb6f/68747470733a2f2f696d672e736869656c64732e696f2f686578706d2f6c2f706c75672e7376673f6d61784167653d32353932303030267374796c653d666c61742d737175617265)](https://github.com/bvanhoekelen/terminal-style/blob/master/LICENSE)[![GitHub release](https://camo.githubusercontent.com/e998b927e995b6685d3fcb5f0c06c28c9433ba25a710f86161e9e36f50fc234f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6276616e686f656b656c656e2f7465726d696e616c2d7374796c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/bvanhoekelen/terminal-style/releases)[![Packagist](https://camo.githubusercontent.com/e76ad9cd0ed13c55f9338906ab731c07017ae0f8b5fb7dc2e3a015cc29a2c94c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6276616e686f656b656c656e2f7465726d696e616c2d7374796c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bvanhoekelen/terminal-style)[![Github issues](https://camo.githubusercontent.com/51cdc2dde28265ce5feabb3013a90b0a4d2911b76bb5833656b8a67e646a9cf8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6276616e686f656b656c656e2f7465726d696e616c2d7374796c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/bvanhoekelen/terminal-style/issues)

Highlight
---------

[](#highlight)

- The easiest way to style your text in the command line / terminal
- Change text color to red, green, yellow ... » [Text color](#text-color)
- Change background color to red, green, yellow ... » [Background color](#background-color)
- Change background in customer 8-bit color » [Custom background color](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-custom-background)
- Change text style to bold, dim, underlined, blink ... » [Text style](#text-style)
- Support for Laravel framework » [Laravel](https://laravel.com)
- Easy to install » [installation](#installation)
- Love feedback » [backlog](https://github.com/bvanhoekelen/terminal-style/blob/master/BACKLOG.md) or [create issues](https://github.com/bvanhoekelen/terminal-style/issues)

How to use
----------

[](#how-to-use)

```
 echo terminal_style($message = null, $color = null, $background = null, $style = null);
```

Text color
----------

[](#text-color)

[![PHP Terminal style set text color](/assets/terminal-text-color.png)](/assets/terminal-text-color.png)

### Code example

[](#code-example)

```
// Print red text
echo terminal_style('Here your text', 'red');
```

### Text color names

[](#text-color-names)

Use can use: `default`, `yellow`, `red`, `green`, `light-gray` [...](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-text-color-names)

See [the full color name list here](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-text-color-names)

Background color
----------------

[](#background-color)

[![PHP Terminal style set background color](/assets/terminal-background-color.png)](/assets/terminal-background-color.png)

### Code example

[](#code-example-1)

```
// Print text with background red
echo terminal_style('Here your text', null, 'red');
```

### Background colors names

[](#background-colors-names)

Use can use: `default`, `yellow`, `red`, `green`, `light-gray` [...](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-background-color-names)

See [the full background color name list here](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-background-color-names) or see [custom background color](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-custom-background)

Text style
----------

[](#text-style)

[![PHP Terminal style set style](/assets/terminal-text-style.png)](/assets/terminal-text-style.png)

### Code example

[](#code-example-2)

```
// Print text style bold
echo terminal_style('Here your text', null, null, 'bold');
```

### Text styles

[](#text-styles)

Use can use: `default`, `bold `, `dim`, `italic`, `underlined`, 'blink' [...](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-text-style-names)

See [the full text style name list here](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-text-style-names)

Help, docs and links
====================

[](#help-docs-and-links)

- [Wiki](https://github.com/bvanhoekelen/terminal-style/wiki)
- [Backlog](https://github.com/bvanhoekelen/terminal-style/blob/master/BACKLOG.md)
- [Change log](https://github.com/bvanhoekelen/terminal-style/blob/master/CHANGELOG.md)
- [Packagist](https://packagist.org/packages/bvanhoekelen/terminal-style)

Backlog &amp; Feedback
----------------------

[](#backlog--feedback)

If you have any suggestions to improve this php terminal style tool? Please add your feature, bug or improvement to the [BACKLOG.dm](https://github.com/bvanhoekelen/terminal-style/blob/master/BACKLOG.md). Or create a [issues](https://github.com/bvanhoekelen/terminal-style/issues).

- [Open backlog](https://github.com/bvanhoekelen/terminal-style/blob/master/BACKLOG.md)
- [Create issues](https://github.com/bvanhoekelen/terminal-style/issues)

Installation
============

[](#installation)

Install with Laravel
--------------------

[](#install-with-laravel)

Get PHP terminal style tool by running the Composer command in the command line.

```
 $ composer require bvanhoekelen/terminal-style

```

Open your file and use `terminal_style()`

```
// Print red text
echo terminal_style('Here your text', 'red');
```

Install with composer
---------------------

[](#install-with-composer)

Get PHP terminal style tool by running the Composer command in the command line.

```
 $ composer require bvanhoekelen/terminal-style

```

Open your file and use `terminal_style()`

```
// Require vender autoload
require_once('../vendor/autoload.php');

// Print red text
echo terminal_style('Here your text', 'red');
```

Overview
--------

[](#overview)

[![PHP Terminal style all styles](/assets/terminal-all-styles.png)](/assets/terminal-all-styles.png)

Custom background
-----------------

[](#custom-background)

[![PHP Terminal style custom backgroud](/assets/terminal-custom-background.png)](/assets/terminal-custom-background.png)

See [custom background color](https://github.com/bvanhoekelen/terminal-style/wiki/style-%C2%BB-custom-background)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% 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 ~203 days

Recently: every ~252 days

Total

6

Last Release

2299d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae4ee069f1a323e71f722f3f738e807b7ed7403444054bd64d01618ef1de121b?d=identicon)[Bart van Hoekelen](/maintainers/Bart%20van%20Hoekelen)

---

Top Contributors

[![bvanhoekelen](https://avatars.githubusercontent.com/u/5804062?v=4)](https://github.com/bvanhoekelen "bvanhoekelen (52 commits)")[![vesper8](https://avatars.githubusercontent.com/u/816028?v=4)](https://github.com/vesper8 "vesper8 (1 commits)")

---

Tags

ansibashcolorcommand-linecommand-line-toolphpstyleterminalphpcommand-lineterminalansicolorsbashterminal colorsphp terminal colorsphp terminal stylecommand line colorscommand line style8-bits background colorANSI color codes

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bvanhoekelen-terminal-style/health.svg)

```
[![Health](https://phpackages.com/badges/bvanhoekelen-terminal-style/health.svg)](https://phpackages.com/packages/bvanhoekelen-terminal-style)
```

###  Alternatives

[league/climate

PHP's best friend for the terminal. CLImate allows you to easily output colored text, special formats, and more.

1.9k14.0M273](/packages/league-climate)[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2582.1M11](/packages/nunomaduro-laravel-console-task)[alecrabbit/php-console-spinner

Extremely flexible spinner for \[async\] php cli applications

24032.0k2](/packages/alecrabbit-php-console-spinner)[php-school/learn-you-php

An introduction to PHP's core features: i/o, http, arrays, exceptions and so on.

3192.0k](/packages/php-school-learn-you-php)[alecrabbit/php-cli-snake

Lightweight cli spinner with zero dependencies

29211.3k5](/packages/alecrabbit-php-cli-snake)

PHPackages © 2026

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