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

Stdio React Laravel Package

clue/stdio-react

ReactPHP-based STDIO stream wrapper for non-blocking access to STDIN/STDOUT/STDERR. Enables event-driven CLI apps with readable and writable streams, integrating terminal input/output into the ReactPHP loop for async command-line tools.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Interactive CLI Applications: Enables building highly responsive, event-driven CLI tools (e.g., REPLs, debuggers, or real-time data dashboards) where user input triggers immediate system responses.
  • Rich Input/Output Features: Supports password masking, autocomplete, cursor control, and history—critical for tools like password managers, form-based CLIs, or IDE-like interfaces.
  • Asynchronous Architecture: Aligns with ReactPHP’s event loop, enabling seamless integration with async PHP apps (e.g., APIs, microservices with CLI components).
  • UTF-8 and TTY Awareness: Resolves cross-platform issues (Windows/Linux/macOS) for global teams, ensuring consistent behavior in internationalized or multi-language environments.
  • Build vs. Buy: Avoids reinventing wheel for async I/O; leverages mature ReactPHP ecosystem (e.g., HTTP clients, databases) for cohesive system design.
  • Roadmap Priorities:
    • Phase 1: Replace legacy ext-readline in existing CLI tools (e.g., Laravel Artisan, Symfony Console) for modern async support.
    • Phase 2: Build new interactive tools (e.g., a real-time analytics CLI or collaborative debugging interface).
    • Phase 3: Integrate with ReactPHP-based services (e.g., WebSocket CLI bridges or async task runners).

When to Consider This Package

  • Adopt if:

    • Your CLI needs real-time interactivity (e.g., live updates, autocomplete, or keybindings).
    • You’re using ReactPHP or need async I/O (e.g., combining CLI with HTTP/WebSocket streams).
    • You require UTF-8 support or cross-platform TTY handling (e.g., Windows compatibility).
    • You want to avoid PHP extensions (e.g., ext-readline) for portability or security.
    • Building complex input forms (e.g., password prompts, multi-line editors, or history-aware tools).
  • Look elsewhere if:

    • Your CLI is simple (e.g., one-off scripts with fgets() or Symfony Console).
    • You need blocking I/O (e.g., legacy systems or synchronous workflows).
    • Your team lacks ReactPHP experience (steep learning curve for event loops).
    • You prioritize minimal dependencies (this package requires ReactPHP).
    • You need GUI features (e.g., mouse support or colors beyond ANSI—consider symfony/console or box/spout).

How to Pitch It (Stakeholders)

For Executives:

"This package lets us build next-gen CLI tools that feel like modern apps—responsive, interactive, and cross-platform*. Think of it as React for the terminal: async, event-driven, and ready for real-time workflows. For example:

  • Debugging: Instantly inspect async services without blocking.
  • DevOps: Interactive dashboards for Kubernetes or logs with autocomplete.
  • Security: Password prompts with masking and history (no more ext-readline hacks). It’s a strategic bet on async PHP, aligning with our ReactPHP investments and reducing tech debt from legacy CLI code."*

For Engineers:

*"clue/stdio-react gives us:

  1. Async I/O: No more stream_get_line() hacks—true event-driven input/output.
  2. TTY Superpowers: UTF-8, cursor control, and history—all without extensions.
  3. ReactPHP Integration: Plugs into our existing event loop for seamless async workflows.
  4. Future-Proof: Avoids vendor lock-in (MIT license) and plays well with Symfony/League tools.

Trade-offs:

  • Requires ReactPHP knowledge (but we’re already using it for HTTP).
  • Slightly heavier than symfony/console for simple cases.

Use cases:

  • Replace ext-readline in Artisan/Symfony Console.
  • Build a real-time CLI for our API (e.g., WebSocket + terminal).
  • Add autocomplete to our config tool without reinventing the wheel.

Next steps:

  • Spike a prototype for [specific tool X].
  • Compare performance vs. symfony/console for our top 3 CLI commands.
  • Align with the async PHP roadmap."*
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.
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony
spatie/flare-daemon-runtime