Search by

hypervel / prompts

albertchtbinaryfire

Add beautiful and user-friendly forms to your command-line applications.

Package info

github.com/hypervel/prompts

Issues

pkg:composer/hypervel/prompts

Statistics

Installs: 21 836

Dependents: 12

Suggesters: 0

Stars: 0

v0.3.28 2026-03-05 03:28 UTC

README

Ask DeepWiki

Documentation: https://hypervel.org/docs/prompts

Differences From Laravel

  • Spinners are animated by a coroutine instead of a forked process, so spin() animates only inside a Swoole coroutine. Outside one, it shows a static spinner while the callback runs.
  • Prompt::interactive(), fallbackWhen(), fallbackUsing(), setOutput(), and validateUsing() apply only to the current coroutine when called inside one, so one coroutine's settings do not leak into others in the same worker. Use Coroutine::fork() to pass these settings to child coroutines. Call them outside a coroutine, such as during boot, to apply them globally.
  • Logger::prefix() is not available because Task output uses binary frames. Override write() to customize transport writes.
  • NumberPrompt::wrapValidation() is replaced by validateIntrinsic(), which every execution mode calls. Custom prompts should override validateIntrinsic() for rules that belong to the prompt type.
  • DataTableRenderer::computeColumnWidths() is split into DataTablePrompt::naturalColumnMetrics(), which measures the content once per prompt, and DataTableRenderer::fitColumnWidths(), which fits those widths to the terminal on each render. Override whichever method covers the step you need to change.

Ported from: https://github.com/laravel/prompts