Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Stdio React

Stdio React Laravel Package

clue/stdio-react

Async, UTF-8 aware console input and output for interactive CLI apps built on ReactPHP. React to typed lines or keypresses, with prompts, echo, editing, history, autocomplete, and proper TTY handling.

View on GitHub
Deep Wiki
Context7

Async, event-driven and UTF-8 aware console input & output (STDIN, STDOUT) for truly interactive CLI applications, built on top of ReactPHP.

Frequently asked questions about Stdio React
Is clue/stdio-react a Laravel package and how do I install it?
It is not a Laravel package; it is a ReactPHP component for async STDIN/STDOUT handling. Install it with composer require clue/stdio-react; there is no service provider or config file to publish. In Laravel you use it inside a long-running Artisan command, not in HTTP controllers or middleware.
How do I use clue/stdio-react inside an Artisan command?
Instantiate Stdio with a ReactPHP LoopInterface, wire data, close, and error handlers, and call $loop->run() inside your command's handle() method. Use try/finally to call $stdio->end() so the terminal is restored. Keep the loop as a container singleton if other async components appear later.
Which Laravel and PHP versions work with clue/stdio-react?
It installs cleanly on Laravel 10 through 12 with PHP 8.1+ and depends on ReactPHP components plus ext-mbstring. Laravel version support is indirect because the package only runs inside a CLI process that owns a TTY. Verify the release tag and changelog before pinning, since the stated release date is anomalous.
Should I use clue/stdio-react or Laravel Prompts for interactive console input?
Use Laravel Prompts or Symfony Console QuestionHelper for ordinary blocking prompts such as $this->ask(). Use clue/stdio-react only when you need interleaved I/O, keypress handling, or UTF-8-aware editing while output is still printing. For a single question-and-answer flow, the async library is over-engineering.
Why do my prompts get corrupted when mixing clue/stdio-react with Symfony Console or readline?
Only one component can own STDIN and the terminal in a process. Symfony Console, laravel/prompts, and ext-readline assume blocking reads and manipulate termios and escape sequences, so mixing them with Stdio produces corrupted prompts. Funnel all output through Stdio::write() as well, or $this->line(), Monolog-to-STDOUT, and progress bars will interleave destructively.
Does clue/stdio-react work in Docker, CI, and on Windows?
Terminal handling depends on TTY semantics; on Unix it uses termios and on Windows guarantees are weaker. It fails silently in Docker without -t, in CI, and in some PowerShell or IDE terminals. Provide a non-TTY fallback that skips interactive Stdio behavior when stream_isatty() is false.
Why does my Artisan command freeze while using clue/stdio-react?
ReactPHP is single-threaded, so any Eloquent query, sleep(), or blocking file read inside a data handler stops echo and cursor rendering. Move blocking work out of the handler or run it before entering the loop. Laravel developers used to synchronous requests often miss this failure mode.
How do I test clue/stdio-react TTY behavior in CI?
Unit tests can cover handlers, but real TTY behavior needs a pty or expect-style harness. Add an integration test that spawns the Artisan command under a pseudo-terminal and asserts prompt output and terminal restoration. Keep a non-TTY test path for CI environments without a terminal.
Is clue/stdio-react safe for production given its maintenance status?
It has a small API, claimed 100% coverage, and a stable ReactPHP v1 ecosystem, but it is a single-maintainer package with low Packagist usage and little Laravel prior art. Treat it as a critical-path dependency only after verifying releases and deciding whether to vendor or fork it. The main risks are maintenance and terminal environment assumptions, not code quality.
How do I handle Ctrl+C and restore the terminal with clue/stdio-react?
Register signal handlers with $loop->addSignal() or pcntl_signal() for SIGINT and SIGTERM, and call $stdio->end() in a finally block. This ensures the terminal is restored if the command exits or is interrupted. Test the interrupt path under a pty, because a failed restoration leaves the user's shell in a broken state.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource