Weave Code
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

Term React Laravel Package

clue/term-react

ReactPHP-powered interactive terminal for PHP. Read keypresses and line input from STDIN without blocking, work with streams and events, and build responsive CLI apps that react to user input in real time.

Deep Wiki
Context7

clue/term-react brings a ReactPHP-powered event loop to the terminal, making it easy to build interactive CLI/TUI apps that react to keystrokes, window resizing, and timed events without blocking. It integrates cleanly with React’s Streams and Promises, enabling responsive, non-blocking command-line interfaces in pure PHP.

Features

  • Non-blocking STDIN handling for keypress-driven UIs
  • Emits terminal events (e.g. resize) to update layouts live
  • Works with ReactPHP Loop, Stream, and Promise components
  • Simple API for composing interactive prompts and widgets
  • Ideal foundation for real-time CLI tools, dashboards, and monitors
Frequently asked questions about Term React
Can clue/term-react be used directly in a Laravel HTTP request handler?
No, it cannot. Laravel’s HTTP kernel is synchronous and relies on the Symfony HTTP foundation, which conflicts with ReactPHP’s event-driven model. You’d need to run it in a separate process (e.g., a standalone ReactPHP daemon) and communicate via queues or sockets.
What Laravel-compatible alternatives exist for terminal-based UIs?
For Laravel, consider Symfony’s Process component for CLI task execution, or dedicated CLI toolkits like Laravel Nova’s CLI tools or Symfony Console. For async workflows, Laravel’s queue workers (with Horizon) are better suited than ReactPHP for most use cases.
How do I install clue/term-react in a Laravel project?
Use Composer: `composer require clue/term-react`. However, integration requires running ReactPHP’s event loop outside Laravel’s HTTP context—typically in a separate CLI script or worker process. Avoid mixing it with Laravel’s request lifecycle.
Does clue/term-react support Laravel’s queue system for async tasks?
No, it doesn’t natively integrate with Laravel queues. ReactPHP’s event loop is incompatible with Laravel’s queue workers (e.g., Horizon). You’d need custom inter-process communication, like Redis pub/sub or Unix sockets, to bridge the two systems.
What Laravel versions are compatible with clue/term-react?
The package itself doesn’t enforce Laravel version constraints, but its ReactPHP dependency makes it incompatible with Laravel’s synchronous architecture. Use it only in isolated async environments (e.g., a separate CLI process) alongside Laravel.
How do I handle terminal input/output in a Laravel Artisan command?
For Artisan commands, use Symfony’s Console component or Laravel’s built-in CLI helpers. clue/term-react isn’t designed for Laravel’s CLI tools—it’s for standalone ReactPHP applications. Mixing them risks event loop conflicts and crashes.
Is clue/term-react production-ready for Laravel applications?
No, it’s not recommended for Laravel. The package’s low adoption (104 stars) and lack of Laravel-specific integration suggest high risk. Test it only in isolated, non-critical environments with dedicated ReactPHP expertise before considering production use.
Can I use clue/term-react for real-time dashboards in Laravel?
Only if you run it as a separate service (e.g., a ReactPHP daemon) and communicate with Laravel via APIs or message queues. Direct integration with Laravel’s HTTP layer is impossible due to architectural conflicts. Consider Laravel Echo or Laravel WebSockets for real-time UIs instead.
What are the maintenance challenges of using clue/term-react in Laravel?
Expect high maintenance due to low community support and ReactPHP’s complexity. Bug fixes, security patches, and version upgrades will likely require in-house effort. Laravel’s ecosystem (e.g., Symfony components) may also introduce dependency conflicts.
How do I debug issues when mixing clue/term-react with Laravel?
Debugging is difficult due to the async/sync conflict. Logs from ReactPHP’s event loop won’t align with Laravel’s request lifecycle. Isolate the ReactPHP process entirely and use separate logging (e.g., Monolog in both systems) to track issues without interference.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport