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

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

khalyomede/console-reporter
===========================

Display a progress bar and logs in the same time to the console.

v0.3.0(7y ago)1931MITPHPPHP &gt;=7.2.0

Since Sep 13Pushed 7y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (10)Used By (1)

Console reporter
================

[](#console-reporter)

[![PHP from Packagist](https://camo.githubusercontent.com/426f787449e556884884c4dae824df637ebef1f1bd55987ef8f8c0e466b0c9d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b68616c796f6d6564652f636f6e736f6c652d7265706f727465722e737667)](https://camo.githubusercontent.com/426f787449e556884884c4dae824df637ebef1f1bd55987ef8f8c0e466b0c9d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b68616c796f6d6564652f636f6e736f6c652d7265706f727465722e737667)[![Packagist](https://camo.githubusercontent.com/d69d2cdc201ab813ec26aceae1881e7646f149dc39a65e0292274ab8670332e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b68616c796f6d6564652f636f6e736f6c652d7265706f727465722e737667)](https://camo.githubusercontent.com/d69d2cdc201ab813ec26aceae1881e7646f149dc39a65e0292274ab8670332e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b68616c796f6d6564652f636f6e736f6c652d7265706f727465722e737667)[![Packagist](https://camo.githubusercontent.com/361276031146f7f2ff07572305d6693a2b26fed3753138d54030514394d68d08/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b68616c796f6d6564652f636f6e736f6c652d7265706f727465722e737667)](https://camo.githubusercontent.com/361276031146f7f2ff07572305d6693a2b26fed3753138d54030514394d68d08/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b68616c796f6d6564652f636f6e736f6c652d7265706f727465722e737667)

[![Gif showing a command line that trigger the console report, with the progress bar and the logs that stack themselves above the progress bar as the progress bar advance until 100 percent](https://camo.githubusercontent.com/26ddb51873ece29ad3bf121aba71757934f177969b23b42d8541a08b6d514709/68747470733a2f2f696d6167652e6962622e636f2f6e363346757a2f6c616e64696e675f6769665f325f6b68616c796f6d6564655f636f6e736f6c655f7265706f727465722e676966)](https://camo.githubusercontent.com/26ddb51873ece29ad3bf121aba71757934f177969b23b42d8541a08b6d514709/68747470733a2f2f696d6167652e6962622e636f2f6e363346757a2f6c616e64696e675f6769665f325f6b68616c796f6d6564655f636f6e736f6c655f7265706f727465722e676966)

Summary
-------

[](#summary)

- [Installation](#installation)
- [Example of use](#example-of-use)
- [Available built-in progress bar styles](#available-built-in-progress-bar-styles)
- [Supported shells](#supported-shells)

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

[](#installation)

```
composer require --dev khalyomede/console-reporter:0.*
```

Example of use
--------------

[](#example-of-use)

- [Example 1: simple use case](#example-1-simple-use-case)
- [Example 2: using a built-in progress bar style](#example-2-using-a-built-in-progress-bar-style)
- [Example 3: using your own progress bar style](#example-3-using-your-own-progress-bar-style)
- [Example 4: display logs using icons](#example-4-display-logs-using-icons)
- [Example 5: force the size of the progress bar](#example-5-force-the-size-of-the-progress-bar)

### Example 1: simple use case

[](#example-1-simple-use-case)

```
require(__DIR__ . '/../vendor/autoload.php');

use Khalyomede\ConsoleReporter as Reporter;

$reporter = new Reporter;
$reporter->setMaxEntries(24);

foreach( range(1, 24) as $integer ) {
  $sleepTimeInMicroseconds = rand(5000, 500000);

  usleep($sleepTimeInMicroseconds);

  if( $integer % 8 === 0 ) {
    $reporter->info("test #$integer in progression...");
  }

  $reporter->report();
  $reporter->advance();
}
```

```
$ php example/example-1.php
  2018-09-16 08:45:29.595600 [INFO] test #8 in progression...
  2018-09-16 08:45:32.205500 [INFO] test #16 in progression...
  2018-09-16 08:45:34.570100 [INFO] test #24 in progression...
  24 / 24 ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100 %
```

### Example 2: using a built-in progress bar style

[](#example-2-using-a-built-in-progress-bar-style)

```
require(__DIR__ . '/../vendor/autoload.php');

use Khalyomede\ConsoleReporter as Reporter;
use Khalyomede\Style\ModernRounded;

$reporter = new Reporter;
$reporter->setMaxEntries(24);
$reporter->setStyle(ModernRounded::class);

foreach( range(1, 24) as $integer ) {
  $sleepTimeInMicroseconds = rand(5000, 500000);

  usleep($sleepTimeInMicroseconds);

  if( $integer % 8 === 0 ) {
    $reporter->info("test #$integer in progression...");
  }

  $reporter->report();
  $reporter->advance();
}
```

```
$ php example/example-2.php
  2018-09-29 18:07:40.433600 [INFO] test #8 in progression...
  2018-09-29 18:07:42.810300 [INFO] test #16 in progression...
  2018-09-29 18:07:45.291100 [INFO] test #24 in progression...
  24 / 24 [●●●●●●●●●●●●●●●●●●●●●●●●] 100 %

```

### Example 3: using your own progress bar style

[](#example-3-using-your-own-progress-bar-style)

```
require(__DIR__ . '/../vendor/autoload.php');

use Khalyomede\ConsoleStylable;
use Khalyomede\ConsoleReporter as Reporter;

class ModernStar implements ConsoleStylable {
  public static function progressingCharacter(): string {
    return '✧';
  }

  public static function progressedCharacter(): string {
    return '✦';
  }

  public static function startCharacter(): string {
    return '[';
  }

  public static function endCharacter(): string {
    return ']';
  }
}

const MAX = 24;

$numbers = range(1, MAX);

$reporter = new Reporter;

$reporter->setMaxEntries(MAX);
$reporter->setStyle(ModernStar::class);

foreach( $numbers as $number ) {
  $microseconds = rand(50000, 500000);

  usleep($microseconds);

  if( $number % 8 === 0 ) {
    $reporter->info("running iteration #$number");
  }

  $reporter->report();
  $reporter->advance();
}
```

```
$ php example/example-3.php
  2018-09-29 20:34:16.945300 [INFO] running iteration #8
  2018-09-29 20:34:18.934700 [INFO] running iteration #16
  2018-09-29 20:34:21.071200 [INFO] running iteration #24
  24 / 24 [✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦] 100 %
```

### Example 4: display logs using icons

[](#example-4-display-logs-using-icons)

```
require(__DIR__ . '/../vendor/autoload.php');

use Khalyomede\ConsoleReporter as Reporter;

$reporter = new Reporter;
$reporter->setMaxEntries(24);
$reporter->displaySeverityWithIcons();

foreach( range(1, 24) as $integer ) {
  $sleepTimeInMicroseconds = rand(5000, 500000);

  usleep($sleepTimeInMicroseconds);

  if( $integer % 8 === 0 ) {
    $reporter->info("test #$integer in progression...");
  }

  $reporter->report();
  $reporter->advance();
}
```

```
$ php example/example-4.php
  2018-10-04 21:42:31.842600  ⓘ  test #8 in progression...
  2018-10-04 21:42:33.992700  ⓘ  test #16 in progression...
  2018-10-04 21:42:35.393700  ⓘ  test #24 in progression...
  24 / 24 ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100 %
```

### Example 5: force the size of the progress bar

[](#example-5-force-the-size-of-the-progress-bar)

```
require(__DIR__ . '/../vendor/autoload.php');

use Khalyomede\ConsoleReporter as Reporter;

$reporter = new Reporter;
$reporter->setMaxEntries(10);
$reporter->setProgressBarSize(30);

$numbers = range(0, 9);

foreach( $numbers as $number ) {
  $sleepTimeInMicroSeconds = rand(50000, 500000);

  usleep($sleepTimeInMicroSeconds);

  $reporter->report();
  $reporter->advance();
}
```

```
$ php example/example-5.php
  10 / 10 ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100 %
```

Available built-in progress bar styles
--------------------------------------

[](#available-built-in-progress-bar-styles)

- [Modern rounded](#modern-rounded)
- [Modern rectangular](#modern-rectangular)

### Modern rounded

[](#modern-rounded)

```
2018-09-30 14:52:31.158200 [INFO] test #8 in progression...
2018-09-30 14:52:32.366100 [INFO] test #16 in progression...
2018-09-30 14:52:33.885100 [INFO] test #24 in progression...
24 / 24 [●●●●●●●●●●●●●●●●●●●●●●●●] 100 %
```

### Modern rectangular

[](#modern-rectangular)

```
2018-09-30 14:55:05.430200 [INFO] test #8 in progression...
2018-09-30 14:55:07.795900 [INFO] test #16 in progression...
2018-09-30 14:55:09.755300 [INFO] test #24 in progression...
24 / 24 [◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼] 100 %
```

Supported shells
----------------

[](#supported-shells)

Operating systemShellTested ?Working ?Need configuration ?Windowsbash✔✔WindowsMS-DOS✔✔yesWindowsPowerShell✔✔yesDo no see your OS or shell ? This means it has not been tested.

You are more than welcomed if you want to test it in another configuration than one of the above. Just fill in an issue.

### PowerShell configuration

[](#powershell-configuration)

Check that your font configuration is **not** set to `Raster Fonts`:

[![Photo of the powersheel configuration panel, on the font section](https://camo.githubusercontent.com/aee40d62aab1677956852905593af98f7cd09d2c0aa44dd9eb07586d3a074195/68747470733a2f2f696d6167652e6962622e636f2f62373963374b2f506f7765725f5368656c6c5f50726f706572746965735f466f6e745f73697a655f7468756d622e706e67)](https://camo.githubusercontent.com/aee40d62aab1677956852905593af98f7cd09d2c0aa44dd9eb07586d3a074195/68747470733a2f2f696d6167652e6962622e636f2f62373963374b2f506f7765725f5368656c6c5f50726f706572746965735f466f6e745f73697a655f7468756d622e706e67)

Check it to something else than `Raster Fonts`. The characters used in some progress bar should now apear correctly.

Credits
-------

[](#credits)

Powershell font photo taken from [4sysops](https://4sysops.com/archives/change-powershell-console-font-size-with-cmdlet/)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Total

9

Last Release

2755d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15908747?v=4)[Anwar](/maintainers/khalyomede)[@khalyomede](https://github.com/khalyomede)

### Embed Badge

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

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

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M319](/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)
