PHPackages                             clue/stdio-react - 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. clue/stdio-react

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

clue/stdio-react
================

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

v2.6.0(4y ago)19810.2M—0.3%20[4 issues](https://github.com/clue/reactphp-stdio/issues)[1 PRs](https://github.com/clue/reactphp-stdio/pulls)20MITPHPPHP &gt;=5.3CI passing

Since Sep 9Pushed 1y ago6 watchersCompare

[ Source](https://github.com/clue/reactphp-stdio)[ Packagist](https://packagist.org/packages/clue/stdio-react)[ Docs](https://github.com/clue/reactphp-stdio)[ Fund](https://clue.engineering/support)[ GitHub Sponsors](https://github.com/clue)[ RSS](/packages/clue-stdio-react/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (20)

clue/reactphp-stdio
===================

[](#cluereactphp-stdio)

[![CI status](https://github.com/clue/reactphp-stdio/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/reactphp-stdio/actions)[![code coverage](https://camo.githubusercontent.com/2d45ae33b28ed0c5f14fdba645e579072cf437770a215524795c9eb258581b1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6465253230636f7665726167652d3130302532352d73756363657373)](#tests)[![installs on Packagist](https://camo.githubusercontent.com/1598f3331d0c4b4a8245d9d9a54c2ccb90cc6adf2f6adec9c29ceb1d39839584/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c75652f737464696f2d72656163743f636f6c6f723d626c7565266c6162656c3d696e7374616c6c732532306f6e2532305061636b6167697374)](https://packagist.org/packages/clue/stdio-react)

Async, event-driven and UTF-8 aware console input &amp; output (STDIN, STDOUT) for truly interactive CLI applications, built on top of [ReactPHP](https://reactphp.org/).

You can use this library to build truly interactive and responsive command line (CLI) applications, that immediately react when the user types in a line or hits a certain key. Inspired by `ext-readline`, but supports UTF-8 and interleaved I/O (typing while output is being printed), history and autocomplete support and takes care of proper TTY settings under the hood without requiring any extensions or special installation.

**Table of contents**

- [Support us](#support-us)
- [Quickstart example](#quickstart-example)
- [Usage](#usage)
    - [Stdio](#stdio)
        - [Output](#output)
        - [Input](#input)
        - [Prompt](#prompt)
        - [Echo](#echo)
        - [Input buffer](#input-buffer)
        - [Cursor](#cursor)
        - [History](#history)
        - [Autocomplete](#autocomplete)
        - [Keys](#keys)
        - [Bell](#bell)
    - [Readline](#readline)
- [Pitfalls](#pitfalls)
- [Install](#install)
- [Tests](#tests)
- [License](#license)
- [More](#more)

Support us
----------

[](#support-us)

We invest a lot of time developing, maintaining and updating our awesome open-source projects. You can help us sustain this high-quality of our work by [becoming a sponsor on GitHub](https://github.com/sponsors/clue). Sponsors get numerous benefits in return, see our [sponsoring page](https://github.com/sponsors/clue)for details.

Let's take these projects to the next level together! 🚀

Quickstart example
------------------

[](#quickstart-example)

Once [installed](#install), you can use the following code to present a prompt in a CLI program:

```
