PHPackages                             lupecode/console - 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. lupecode/console

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

lupecode/console
================

A library for printing to the console.

0.7.1(5y ago)145GPL-3.0-or-laterPHPPHP &gt;=7.0.0

Since Jan 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/LupeCode/Console)[ Packagist](https://packagist.org/packages/lupecode/console)[ RSS](/packages/lupecode-console/feed)WikiDiscussions master Synced 4d ago

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

Console
=======

[](#console)

What is it?
-----------

[](#what-is-it)

This library is a console helper for ANSI colors, progress bars, and tables.

If you have a console that is not Windows command prompt, and you can have color in your console, this library will help you jazz up your PHP console applications.

Requirements
------------

[](#requirements)

This library requires PHP &gt;= 7.0.

### Readline

[](#readline)

If you wish to use `Console::readline`, `Console::promptReadline`, or `Console::optionsReadline` you will need to have the readline module loaded in PHP. On Windows, this requires PHP &gt;= 7.1.0

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

[](#installation)

The best way to install this console helper is to use Composer.

```
composer require lupecode/console
```

How To
------

[](#how-to)

#### tl;dr

[](#tldr)

See the tests folder.

### Basic Print

[](#basic-print)

```
Console::print('Hello World'); // Will not print a new line at the end
Console::printLine('Hello World'); // Will print a new line at the end
```

### Built-in Styles

[](#built-in-styles)

Console has a few built-in styles.

```
Console::printHeader('Header Message'); // Prints the text in a yellow box
Console::printDebug('Debug Message'); // Prints the text in a gray color
Console::printError('Error Message'); // Prints the text in a red color
Console::printStatus('Status Message'); // Prints the text in a blue color
Console::printSuccess('Success Message'); // Prints the text in a green color
```

### 16 Color Palette

[](#16-color-palette)

Console has support for 16 color palette.

```
$color = new Color16();
$color
    ->setBackgroundColor(Color::YELLOW)
    ->setForegroundColor(Color::BLACK)
    ->setFlag(Color::BOLD)
;
Console::printLine('Print Line In Color', $color);
```

### 256 Color Palette

[](#256-color-palette)

Console has support for 256 color palette. These colors range with RGB from 0 to 5 for 216 colors. There are 24 levels of grayscale.

```
$color = new Color256();
$color
    ->setBackgroundColor(5,5,0)
    ->setForegroundColorGrayscale(0)
    ->setFlag(Color::BOLD)
;
Console::printLine('Print Line In Color', $color);
```

### Progress Bars

[](#progress-bars)

Console has support for progress bars.

```
$pBar = Console::progressBar();
$pBar->setBarSize(30)->setTotal(100)->startTimer();
for ($i = 0; $i < 100; $i++) {
    $pBar->increment();
}
$pBar->finish();
```

### Tables

[](#tables)

Console has support for tables.

```
Console::table()
   ->addColumn('ID')
   ->addColumn('Title')
   ->addColumn('ISBN')
   ->addRow([1, 'Lorem Ipsum and the Valley of Goblins', '987-12345678-1'])
   ->addRow([2, 'Lorem Ipsum and the Chair of Sadness', '987-12345678-2'])
   ->addRow([3, 'Lorem Ipsum and the Sands of Itchiness', '987-12345678-3'])
   ->addRow([4, 'Lorem Ipsum and the Lingua Franca', '987-12345678-4'])
   ->printTable()
;
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Recently: every ~145 days

Total

8

Last Release

1977d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fba80d9935d5f32af4ecba3593725ec840bbac6af1cd345260bb0937757df7b0?d=identicon)[LupeCode](/maintainers/LupeCode)

---

Top Contributors

[![jb-lopez](https://avatars.githubusercontent.com/u/8528028?v=4)](https://github.com/jb-lopez "jb-lopez (24 commits)")

### Embed Badge

![Health badge](/badges/lupecode-console/health.svg)

```
[![Health](https://phpackages.com/badges/lupecode-console/health.svg)](https://phpackages.com/packages/lupecode-console)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

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

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/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)
