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

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

nashgao/interactive-shell
=========================

Interactive shell library with pluggable transports and streaming support

v0.1.6(2mo ago)0354↓50%1MITPHPPHP &gt;=8.2

Since Feb 3Pushed 2mo agoCompare

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

READMEChangelog (5)Dependencies (8)Versions (10)Used By (1)

Interactive Shell
=================

[](#interactive-shell)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![PHP Version](https://camo.githubusercontent.com/83dd395020c37276225039739320f6c8e7e99963ab21ee3d09282cb48dad2a60/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c7565)](https://www.php.net/)

Interactive shell library with pluggable transports and streaming support. Build MySQL-like CLI interfaces for your PHP applications with built-in command parsing, history, formatting, and real-time message streaming capabilities.

Documentation
-------------

[](#documentation)

- **[Visual Architecture Guide](docs/guide.md)** - ASCII diagrams, command flows, and troubleshooting

Features
--------

[](#features)

- **Standard Shell (REPL)**: Traditional request/response interactive shell with readline support
- **Streaming Shell**: Bidirectional streaming for real-time message processing (Swoole coroutines)
- **Pluggable Transports**: Unix Socket (Swoole), or implement your own via `TransportInterface`
- **Multiple Output Formats**: Table (ASCII), JSON, CSV, Vertical (MySQL `\G` style)
- **Advanced Command Parsing**: Quote handling, escape sequences, options (`--format=json`), and `\G` terminator
- **Shell Features**: Command history with persistence, configurable aliases, multi-line input
- **Client-Side Filtering**: Real-time message filtering in streaming mode
- **Built-in Commands**: Help, status, history, aliases, screen clearing

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- ext-swoole (coroutine-based async I/O)
- Symfony Console ^6.0|^7.0

### Optional Extensions

[](#optional-extensions)

- `ext-readline`: Recommended for better input handling and history navigation

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

[](#installation)

```
composer require nashgao/interactive-shell
```

Quick Start
-----------

[](#quick-start)

### Standard Shell (Request/Response)

[](#standard-shell-requestresponse)

```
