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

Prompts Laravel Package

laravel/prompts

Laravel Prompts adds beautiful, user-friendly interactive forms to PHP CLI apps and Artisan commands. It supports placeholder text, validation, and a browser-like input experience, making it easy to collect and validate user input in the terminal.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • CLI/DevTool UX Enhancement: Accelerate adoption of internal CLI tools (e.g., migrations, deployments, data migrations) by replacing verbose readline() calls with interactive, browser-like forms (e.g., multi-step wizards, conditional workflows).
  • Self-Service Developer Tools: Enable non-engineering teams (e.g., QA, support) to run guided CLI workflows (e.g., "Debug a user’s issue") without manual flag parsing.
  • Build vs. Buy: Buy over custom solutions for:
    • Projects with <3 months of CLI dev effort.
    • Teams lacking CLI/UX expertise (reduces technical debt).
    • Use cases needing validation, autocomplete, or multi-step forms (e.g., database schema updates).
  • Roadmap Priorities:
    • Phase 1: Replace legacy readline() prompts in Artisan commands (e.g., php artisan migrate:fresh).
    • Phase 2: Build internal tooling (e.g., "Data Export Wizard") using Prompts + Laravel backend.
    • Phase 3: Expose as a shared library for microservices needing CLI input (e.g., Kubernetes operators).

When to Consider This Package

Adopt If:

  • Your CLI tools require user input beyond simple readline() (e.g., dropdowns, validation, multi-step forms).
  • You’re using Laravel Artisan or PHP CLI apps and want consistent, polished UX (e.g., dark/light mode, keyboard navigation).
  • You need conditional logic (e.g., "If user selects ‘Yes,’ show Step 2").
  • Your team lacks terminal UI expertise but needs production-grade prompts (e.g., for internal tools).
  • You’re building interactive migrations, deploy scripts, or admin tools where errors must be clear and recoverable.

Look Elsewhere If:

  • You need minimalist CLI tools (e.g., getopt-style flags) with no UI overhead.
  • Your project is non-PHP (e.g., Python, Node.js) or uses alternative frameworks (e.g., Symfony Console).
  • You require advanced terminal features (e.g., TUI frameworks like Symfony Panels or Box).
  • Your team has dedicated CLI/UX resources and needs custom animations/rendering (e.g., ASCII art, real-time updates).
  • You’re constrained by legacy systems that can’t support PHP 8.1+ (current LTS requirement).

How to Pitch It (Stakeholders)

For Executives:

"Laravel Prompts lets us replace clunky CLI flags with interactive, guided workflows—like a browser form in the terminal. For example:

  • Devs will spend 30% less time debugging migrations with step-by-step validation.
  • Support teams can run self-service diagnostics (e.g., ‘Select the error type → Get a fix’) without engineering help.
  • We avoid reinventing the wheel: This is maintained by Laravel, used by thousands of projects, and MIT-licensed—no vendor lock-in. Investment: <1 sprint to integrate; ROI: Faster onboarding, fewer CLI errors, and happier users."

For Engineering:

"This is a drop-in replacement for readline()/Symfony Console in Artisan commands, with:

  • Modern UI: Dark/light mode, keyboard navigation, and browser-like validation (e.g., required fields, custom errors).
  • Productivity boosts:
    • Multi-step forms (e.g., select()confirm()text()).
    • Dynamic options (e.g., autocomplete for database tables).
    • Progress bars/spinners for long-running tasks.
  • Low risk: MIT license, actively maintained (releases every 2–3 months), and PHP 8.4-compatible. Use case: Replace our custom migrate:fresh prompt with a validated, interactive wizard—saves 2 hours/week in support tickets."

For Developers:

"Key perks:

  • No terminal UI expertise needed: Just chain methods like select()text()confirm().
  • Works with Laravel’s ecosystem: Integrates with Artisan, Queues, and Testing.
  • Examples:
    $name = Prompt::text('Name', default: 'John');
    $role = Prompt::select('Role', ['admin', 'user'], required: true);
    $confirm = Prompt::confirm('Proceed?', default: false);
    
  • Advanced features:
    • Conditional steps: Show Step 2 only if Step 1 = ‘Yes’.
    • Tables/grids: Display data before selection.
    • Non-interactive mode: For CI/CD pipelines. Try it: composer require laravel/prompts → Replace one readline() call today."
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