PHPackages                             fieg/shell - 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. fieg/shell

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

fieg/shell
==========

Interactive shell (cli) component for PHP

1.0(11y ago)321MITPHPPHP &gt;=5.5

Since May 17Pushed 11y agoCompare

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

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Interactive shell (cli) component for PHP

[![Build Status](https://camo.githubusercontent.com/3d09c8e44218858f007be4435d241604f1d8dd79dad9792c8a8a6a9f0d9932bd/68747470733a2f2f7472617669732d63692e6f72672f666965672f7368656c6c2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/fieg/shell)

Getting started
---------------

[](#getting-started)

```
use Fieg\Shell\Shell;
use Fieg\Shell\ShellEvents;

$shell = new Shell();

// handle some commands
$shell->on(ShellEvents::COMMAND, function ($command) use ($shell) {
    switch ($command) {
        case "help":
            $shell->publish('Available commands:');
            $shell->publish('  help   Print this help');
            $shell->publish('  exit   Exit program');
            break;

        case "exit":
            $shell->stop();
            break;

        // echo everything else the user types
        default:
            $shell->publish('echo: ' . $command);
    }
});

// print some info
$shell->publish("This is an interactive shell.");
$shell->publish("Type 'help' for all available commands.");

// start a prompt so we can receive user input
$shell->prompt();

// statements after this are only executed when `$shell->stop()` is called
$shell->run();

echo "Bye!" . PHP_EOL;
```

This library also comes with a history support. With this you can use the up and down arrows to browse through the recently typed commands. To enable the history support, just wrap the Shell class in a HistoryDecorator:

```
$shell = new HistoryDecorator(new Shell());
```

You can also type the command "history" to see a list of all recently typed commands.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

4019d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5eceacbc3912547ac51ba584798cc5a7c1bfae49b714978f62b6e1af389307dd?d=identicon)[fieg](/maintainers/fieg)

---

Top Contributors

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

---

Tags

clishellinteractive

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fieg-shell/health.svg)

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

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k545.6M719](/packages/psy-psysh)[clue/stdio-react

Async, event-driven console input &amp; output (STDIN, STDOUT) for truly interactive CLI applications, built on top of ReactPHP

19810.2M27](/packages/clue-stdio-react)[kevinlebrun/colors.php

Colors for PHP CLI scripts

3426.7M45](/packages/kevinlebrun-colorsphp)[seregazhuk/php-watcher

Automatically restart PHP application once the source code changes

394137.8k4](/packages/seregazhuk-php-watcher)[alecrabbit/php-console-spinner

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

24032.0k2](/packages/alecrabbit-php-console-spinner)[maximebf/consolekit

Library to create command line utilities

114104.4k9](/packages/maximebf-consolekit)

PHPackages © 2026

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