PHPackages                             macroman/terminal-progress-bar - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. macroman/terminal-progress-bar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

macroman/terminal-progress-bar
==============================

Flexible ascii progress bar.

0.1.8(2y ago)5242.9k↓15.6%7GPL-3.0-or-laterPHPPHP &gt;=7.0|&gt;=8.0

Since Nov 3Pushed 2y ago2 watchersCompare

[ Source](https://github.com/MacroMan/PHPTerminalProgressBar)[ Packagist](https://packagist.org/packages/macroman/terminal-progress-bar)[ Docs](https://github.com/MacroMan/PHPTerminalProgressBar)[ RSS](/packages/macroman-terminal-progress-bar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)DependenciesVersions (10)Used By (0)

Flexible ascii progress bar.

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

[](#installation)

```
composer require macroman/terminal-progress-bar

```

Usage
-----

[](#usage)

First we create a `Bar`, giving it a `format` string as well as the `total`, telling the progress bar when it will be considered complete. Then call `tick()` when needed.

```
// examples/basic.php
use TerminalProgress\Bar;

$pg = new Bar(1000);

for ($i = 0; $i < 1000; $i++) {
	usleep(10000);
	$pg->tick();
}
```

You can also use `update(amount)` to set the current tick value instead of ticking each time there is an increment:

```
// examples/update.php
use TerminalProgress\Bar;

$pg = new Bar(1000);

for ($i = 0; $i < 1000; $i++) {
	usleep(10000);
	$pg->update($i);
}
```

### Options

[](#options)

These are properties in the object you can read/set:

- `symbolComplete` Completion character defaulting to "="
- `symbolIncomplete` Incomplete character defaulting to " "
- `throttle` Minimum time between updates in seconds defaulting to 0.016
- `current` Current tick
- `total` Same value passed in when initialising
- `secondPrecision` Number of decimal digits to use in "seconds" units
- `percentPrecision` Number of decimal digits to use in "percentage" units
- `percent` (read only) Current percentage completion
- `eta` (read only) Estimate seconds until completion
- `rate` (read only) Number of ticks per second
- `elapsed` (read only) Seconds since initialisation

### Tokens

[](#tokens)

These are tokens you can use in the format of your progress bar.

- `:bar` the progress bar itself
- `:current` current tick number
- `:total` total ticks
- `:elapsed` time elapsed in seconds
- `:percent` completion percentage
- `:eta` estimated completion time in seconds
- `:rate` rate of ticks per second

### Format example

[](#format-example)

```
// examples/format.php
// Full options
new Bar(10, "Progress: [:bar] - :current/:total - :percent% - Elapsed::elapseds - ETA::etas - Rate::rate/s");
```

```
// examples/format_percent.php
// Just percentage plus the bar
new Bar(10, ":bar :percent%");
```

```
// examples/format_no_bar.php
// You don't even have to have a bar
new Bar(10, "Look mum, no bar! :current/:total - :percent% - Elapsed::elapseds - ETA::etas - Rate::rate/s");
```

### Interrupt example

[](#interrupt-example)

To display a message during progress bar execution, use `interrupt()`

```
// examples/interrupt.php
$pg = new Bar(1000);

for ($i = 0; $i < 1000; $i++) {
	usleep(10000);
	if ($i % 100 == 0) {
		// Interupt every 100th tick
		$pg->interupt($i);
	}
	$pg->tick();
}
```

### Symbols/Precision example

[](#symbolsprecision-example)

To change the symbols or precision used on the progress bar

```
// examples/symbols.php
$pg = new Bar(1000);

$pg->symbolComplete = "#";
$pg->symbolIncomplete = "-";

$pg->secondPrecision = 2;
$pg->percentPrecision = 4;
```

### Throttle example

[](#throttle-example)

The draw interval is throttled at once per 100ms for performance. You can change this value if desired, eg lower for a smoother animation or higher if your work is resource intensive.

```
// examples/throttle.php
$pg = new Bar(1000);
$pg->throttle = 0.05; // Set a 50 millisecond throttle
```

License
-------

[](#license)

See LICENSE

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~117 days

Recently: every ~225 days

Total

9

Last Release

1087d ago

PHP version history (3 changes)0.0.1PHP &gt;=5.6.0

0.1.5PHP &gt;=5.6.0|&gt;=8.0

0.1.8PHP &gt;=7.0|&gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/432ce1b3407973cc49a46ef4297e30723537f5d1f4081a88d95f3cf2b7cf5516?d=identicon)[MacroMan](/maintainers/MacroMan)

---

Top Contributors

[![MacroMan](https://avatars.githubusercontent.com/u/1306658?v=4)](https://github.com/MacroMan "MacroMan (3 commits)")[![diversen](https://avatars.githubusercontent.com/u/142675?v=4)](https://github.com/diversen "diversen (1 commits)")[![marios88](https://avatars.githubusercontent.com/u/302688?v=4)](https://github.com/marios88 "marios88 (1 commits)")

### Embed Badge

![Health badge](/badges/macroman-terminal-progress-bar/health.svg)

```
[![Health](https://phpackages.com/badges/macroman-terminal-progress-bar/health.svg)](https://phpackages.com/packages/macroman-terminal-progress-bar)
```

###  Alternatives

[coderevolutionplugins/gpt-3-encoder-php

PHP BPE Text Encoder/Decoder for GPT-2 / GPT-3

10046.1k](/packages/coderevolutionplugins-gpt-3-encoder-php)[kartik-v/yii2-label-inplace

A form enhancement widget for Yii2 allowing in-field label support.

1181.2k](/packages/kartik-v-yii2-label-inplace)

PHPackages © 2026

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