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

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

fyre/console
============

A CLI library.

v5.0.1(8mo ago)0218↓84.6%4MITPHP

Since May 6Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/elusivecodes/FyreConsole)[ Packagist](https://packagist.org/packages/fyre/console)[ RSS](/packages/fyre-console/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (4)Versions (18)Used By (4)

FyreConsole
===========

[](#fyreconsole)

**FyreConsole** is a free, open-source CLI library for *PHP*.

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Methods](#methods)
- [Static Methods](#static-methods)
- [Colors](#colors)
- [Styles](#styles)

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

[](#installation)

**Using Composer**

```
composer require fyre/console

```

In PHP:

```
use Fyre\Console\Console;
```

Basic Usage
-----------

[](#basic-usage)

- `$input` is the input stream, and will default to `STDIN` (or `null` for non-CLI usage).
- `$output` is the output stream, and will default to `STDOUT` (or "*php://output*" for non-CLI usage).
- `$error` is the error stream, and will default to `STDERR` (or "*php://output*" for non-CLI usage).

```
$io = new Console($input, $output, $error);
```

Methods
-------

[](#methods)

**Choice**

Prompt to make a choice out of available options.

- `$text` is a string representing the prompt text.
- `$options` is an array containing the options.
- `$default` is a string representing the default option, and will default to *null*.

```
$choice = $io->choice($text, $options, $default);
```

**Comment**

Output comment text.

- `$text` is a string representing the text.
- `$options` is an array containing the color options.
    - `color` is a number representing the text [color](#colors), and will default to *null*.
    - `bg` is a number representing the background [color](#colors), and will default to *null*.
    - `style` is a number indicating the text [style](#styles), and will default to `Console::DIM`.

```
$io->comment($text);
```

**Confirm**

Prompt to confirm with y/n options.

- `$text` is a string representing the prompt text.
- `$default` is a boolean representing the default option, and will default to *true*.

```
$confirm = $io->confirm($text, $default);
```

**Error**

Output text to *STDERR*.

- `$text` is a string representing the text.
- `$options` is an array containing the color options.
    - `color` is a number representing the text [color](#colors), and will default to `Console::RED`.
    - `bg` is a number representing the background [color](#colors), and will default to *null*.
    - `style` is a number indicating the text [style](#styles), and will default to *null*.

```
$io->error($text, $options);
```

**Info**

Output info text.

- `$text` is a string representing the text.
- `$options` is an array containing the color options.
    - `color` is a number representing the text [color](#colors), and will default to `Console::BLUE`.
    - `bg` is a number representing the background [color](#colors), and will default to *null*.
    - `style` is a number indicating the text [style](#styles), and will default to *null*.

```
$io->info($text, $options);
```

**Input**

Read a line of input.

```
$input = $io->input();
```

**Progress**

Output a progress indicator.

- `$step` is a number representing the current step, and will default to *null*.
- `$totalSteps` is a number representing the total steps, and will default to *10*.

```
$io->progress($step, $totalSteps);
```

Sequential calls to this method will update the progress indicator. If the `$step` is set to *null* the indicator will be cleared.

**Prompt**

Prompt the user for input.

- `$text` is a string representing the prompt text.

```
$prompt = $io->prompt($text);
```

**Success**

Output success text.

- `$text` is a string representing the text.
- `$options` is an array containing the color options.
    - `color` is a number representing the text [color](#colors), and will default to `Console::GREEN`.
    - `bg` is a number representing the background [color](#colors), and will default to *null*.
    - `style` is a number indicating the text [style](#styles), and will default to *null*.

```
$io->success($text, $options);
```

**Table**

Output a table.

- `$data` is an array containing the table rows.
- `$header` is an array containing the table header columns, and will default to *\[\]*.

```
$io->table($data, $header);
```

**Warning**

Output warning text.

- `$text` is a string representing the text.
- `$options` is an array containing the color options.
    - `color` is a number representing the text [color](#colors), and will default to `Console::YELLOW`.
    - `bg` is a number representing the background [color](#colors), and will default to *null*.
    - `style` is a number indicating the text [style](#styles), and will default to *null*.

```
$io->warning($text, $options);
```

**Write**

Output text to *STDOUT*.

- `$text` is a string representing the text.
- `$options` is an array containing the color options.
    - `color` is a number representing the text [color](#colors), and will default to `Console::YELLOW`.
    - `bg` is a number representing the background [color](#colors), and will default to *null*.
    - `style` is a number indicating the text [style](#styles), and will default to *null*.

```
$io->write($text, $options);
```

Static Methods
--------------

[](#static-methods)

**Get Height**

Get the terminal height (in characters).

```
$height = Console::getHeight();
```

**Get Width**

Get the terminal width (in characters).

```
$width = Console::getWidth();
```

**Style**

Style text for terminal output.

- `$text` is a string representing the text.
- `$options` is an array containing the color options.
    - `color` is a number representing the text [color](#colors), and will default to *null*.
    - `bg` is a number representing the background [color](#colors), and will default to *null*.
    - `style` is a number indicating the text [style](#styles), and will default to *null*.

```
$style = Console::style($text, $options);
```

**Wrap**

Wrap text for terminal output.

- `$text` is a string representing the text.
- `$maxWidth` is a number representing the maximum character width of a line, and will default to the terminal width.

```
$wrap = Console::wrap($text, $maxWidth);
```

Colors
------

[](#colors)

```
Console::BLACK; // 30
Console::RED; // 31
Console::GREEN; // 32
Console::YELLOW; // 33
Console::BLUE; // 34
Console::PURPLE; // 35
Console::CYAN; // 36
Console::WHITE; // 37
Console::GRAY; // 47
Console::DARKGRAY; // 100
```

Styles
------

[](#styles)

```
Console::BOLD; // 1
Console::DIM; // 2
Console::ITALIC; // 3
Console::UNDERLINE; // 4
Console::FLASH; // 5
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance61

Regular maintenance activity

Popularity11

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

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

Recently: every ~33 days

Total

17

Last Release

244d ago

Major Versions

v1.0 → v2.02023-07-16

v2.0.4 → v3.02024-06-08

v3.0.2 → v4.02024-10-30

v4.0.5 → v5.02025-10-16

### Community

Maintainers

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

---

Top Contributors

[![elusivecodes](https://avatars.githubusercontent.com/u/18050480?v=4)](https://github.com/elusivecodes "elusivecodes (21 commits)")

---

Tags

cliconsolephp

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.2k](/packages/illuminate-console)

PHPackages © 2026

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