PHPackages                             rodent/readline - 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. rodent/readline

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

rodent/readline
===============

native readline implementation forked from ridzhi/readline

v0.2.0(9y ago)0478MITPHPPHP &gt;=7.0

Since Mar 23Pushed 3mo agoCompare

[ Source](https://github.com/roelfdiedericks/readline)[ Packagist](https://packagist.org/packages/rodent/readline)[ RSS](/packages/rodent-readline/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Readline
========

[](#readline)

### native readline implementation

[](#native-readline-implementation)

[![CompletionGif](example/example.gif)](example/example.gif)

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

[](#installation)

```
composer require ridzhi/readline

```

Controls
--------

[](#controls)

### Line

[](#line)

- Arrow left/right - move cursor left/right
- Home - move cursor to begin
- End - move cursor to end
- Ctrl+Delete - clear line
- Page up/down - navigate by history
- Tab - complete

### Dropdown

[](#dropdown)

- Arrow up/down - scroll up/down
- Enter - select
- Esc - remove focus/move to line context

Autocomplete
------------

[](#autocomplete)

For autocompletion implement `CompleteInterface`. Also you can use `Parser` helper, which return `Info` object. Info has API for writting completers practically any complexity. For more details see `example` dir.

```
use \Ridzhi\Readline\Info\InfoInterface as IInfo;

class TestCompleter implements \Ridzhi\Readline\CompleteInterface
{

    public function complete(string $input): array
    {
        $info = \Ridzhi\Readline\Info\Parser::parse($input);

        switch ($info->getType()) {
            case IInfo::TYPE_ARG:
                // arg completion
            case IInfo::TYPE_OPTION_SHORT:
                // option completion
            case IInfo::TYPE_OPTION_LONG:
                // option completion
            case IInfo::TYPE_OPTION_VALUE:
                // option values completion
            default:
                return [];
        }

    }

}
```

For most popular frameworks (Yii2, Symfony, Laravel) completers will be written at soon.

Custom handlers
---------------

[](#custom-handlers)

Remove line from current cursor position to end.

```
$readline = new \Ridzhi\Readline\Readline();
//Alt+d
$readline->bind("\033d", function (\Ridzhi\Readline\Line $line) {
    $current = $line->getCurrent();
    $line->clear();
    $line->insert($current);
});
```

Close open parenthesis.

```
$readline = new \Ridzhi\Readline\Readline();

$readline->bind("(", function (\Ridzhi\Readline\Line $line) {
    $line->insert("()");
    $line->cursorPrev();
});
```

Theming
-------

[](#theming)

For custom stylish use `ThemeInterface` implementation.

```
// dark theme file

class DarkTheme implements Ridzhi\Readline\Dropdown\ThemeInterface
{
}

// console app file

// ThemeInterface implements
$readline = new \Ridzhi\Readline\Readline(new DarkTheme());
```

Also you can use `CustomTheme` class, it has ready setters API for you design.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance54

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Total

2

Last Release

3339d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3be66e25ed14a3aecda112873da1e8e450d114cb2afe33ae0dc18f36ab64704e?d=identicon)[roelf.diedericks](/maintainers/roelf.diedericks)

---

Top Contributors

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

---

Tags

autocompletereadline

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rodent-readline/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[twitter/typeahead.js

fast and fully-featured autocomplete library

16.5k209.7k4](/packages/twitter-typeaheadjs)[jetbrains/phpstorm-stubs

PHP runtime &amp; extensions header files for PhpStorm

1.4k27.7M68](/packages/jetbrains-phpstorm-stubs)[corejavascript/typeahead.js

fast and fully-featured autocomplete library

975103.8k2](/packages/corejavascript-typeaheadjs)[phalcon/ide-stubs

The most complete Phalcon Framework IDE stubs library which enables autocompletion in modern IDEs.

1623.1M121](/packages/phalcon-ide-stubs)[bazilio/yii2-stubs-generator

Yii2 component stubs generator for Yii::$app

146720.4k1](/packages/bazilio-yii2-stubs-generator)

PHPackages © 2026

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