PHPackages                             knobik/explorer-prompt - 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. knobik/explorer-prompt

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

knobik/explorer-prompt
======================

0.4.1(7mo ago)04.8k—8.3%MITPHPPHP ^8.1

Since Mar 8Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/knobik/explorer-prompt)[ Packagist](https://packagist.org/packages/knobik/explorer-prompt)[ RSS](/packages/knobik-explorer-prompt/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (28)Used By (0)

Laravel Explorer Prompt
=======================

[](#laravel-explorer-prompt)

Laravel explorer style prompt based on laravel/prompts package. Build CLI table based explorers easily.

 [![](img/files.png)](img/files.png)

### Installation

[](#installation)

```
composer require knobik/explorer-prompt
```

### Simple Example usage:

[](#simple-example-usage)

```
use function Knobik\Prompts\explorer;

$result = explorer(
    items: [
        [1, 'John Doe', 'john.doe@example.com'],
        [2, 'Jane Doe', 'jane.doe@example.com'],
        [3, 'Jan Kowalski', 'kowalski@example.com'],
    ],
    title: 'Hello from a explorer window',
    header: [
        'ID',
        'Name',
        'Email',
    ],
)
    ->prompt();
```

### Filtering

[](#filtering)

You can filter on your data by pressing forward slash `/`.

Filtering prompt can be disabled by using `disableFiltering` method.

You can also create your custom filtering solution by providing an invokable class or function to the `setFilterHandler` method. Example class:

```
use Knobik\Prompts\ExplorerPrompt;

class FilterHandler
{
    public function __invoke(ExplorerPrompt $prompt, string $filter): array
    {
        if ($filter === '') {
            return $prompt->items;
        }

        return collect($prompt->items)
            ->filter(function ($item) use ($prompt, $filter) {
                $item = is_array($item) ? $item : [$item];

                foreach (array_values($item) as $index => $column) {
                    if ($prompt->getColumnFilterable($index) && str_contains($column, $filter)) {
                        return true;
                    }
                }

                return false;
            })
            ->toArray();
    }
}
```

### Advanced file explorer example:

[](#advanced-file-explorer-example)

```
use Knobik\Prompts\Key;
use function Knobik\Prompts\explorer;

function getDirectoryFiles(string $path): array
{
    $files = collect(glob("{$path}/*"))
        ->mapWithKeys(function (string $filename) {
            return [
                $filename => [
                    'filename' => basename($filename),
                    'size' => filesize($filename),
                    'permissions' => sprintf('%o', fileperms($filename)),
                ]
            ];
        });

    if ($path !== '/') {
        $files->prepend([
            'filename' => '..',
            'size' => null,
            'permissions' => sprintf('%o', fileperms(dirname($path)))
        ], dirname($path));
    }

    return $files->toArray();
}

$path = '/var/www/html';
while (true) {
    $newPath = explorer(
        items: $this->getDirectoryFiles($path),
        title: $path, //fn(ExplorerPrompt $prompt) => $prompt->highlighted,
        header: [
            'File name',
            'Size in bytes',
            'Permissions'
        ],
    )
        ->setCustomKeyHandler(Key::KEY_ESCAPE, function(ExplorerPrompt $prompt, string $key) { // custom key handler
            $prompt->cancel();
        })
        ->setColumnOptions(
            column: 2,
            width: 20, // number of characters, null to keep it in auto mode
            align: ColumnAlign::RIGHT,
            filterable: false
        )
        ->prompt();

    if ($newPath === null) {
        continue; // no item selected
    }
    $path = $newPath;

    if (is_file($path)) {
        $this->line(file_get_contents($path));
        return self::SUCCESS;
    }
}
```

###  Health Score

40

—

FairBetter than 87% of packages

Maintenance68

Regular maintenance activity

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.6% 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 ~23 days

Recently: every ~139 days

Total

26

Last Release

220d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5526cc21c5910dfac44c0a253b2c93ab9080c0a78c172849a3a7690b0ec560b5?d=identicon)[knobik](/maintainers/knobik)

---

Top Contributors

[![knobik](https://avatars.githubusercontent.com/u/795254?v=4)](https://github.com/knobik "knobik (29 commits)")[![PiotrGrabowskiWocozon](https://avatars.githubusercontent.com/u/127724110?v=4)](https://github.com/PiotrGrabowskiWocozon "PiotrGrabowskiWocozon (3 commits)")

### Embed Badge

![Health badge](/badges/knobik-explorer-prompt/health.svg)

```
[![Health](https://phpackages.com/badges/knobik-explorer-prompt/health.svg)](https://phpackages.com/packages/knobik-explorer-prompt)
```

###  Alternatives

[livewire/flux

The official UI component library for Livewire.

9385.0M85](/packages/livewire-flux)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M368](/packages/laravel-zero-framework)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[illuminate/reflection

The Illuminate Reflection package.

361.6M3](/packages/illuminate-reflection)

PHPackages © 2026

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