Download the PHP package sugarcraft/sugar-readline without Composer
On this page you can find all versions of the php package sugarcraft/sugar-readline. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sugarcraft/sugar-readline
More information about sugarcraft/sugar-readline
Files in sugarcraft/sugar-readline
Download sugarcraft/sugar-readline
More information about sugarcraft/sugar-readline
Files in sugarcraft/sugar-readline
Vendor sugarcraft
Package sugar-readline
Short Description For this package there is no description available.
License
Package sugar-readline
Short Description For this package there is no description available.
License
Please rate this library. Is it a good library?
Informations about the package sugar-readline
SugarReadline
PHP port of erikgeiser/promptkit — interactive line-editing prompt library for terminal UIs.
Features
- TextPrompt — single-line input with validation, auto-completion, hidden/password mode, char limit, default value
- SelectionPrompt — filtered list with cursor navigation and pagination
- MultiSelectPrompt — filtered multi-choice with min/max enforcement and FIFO rollover at the cap
- ConfirmationPrompt — yes/no with customizable labels, decoupled select-vs-submit
- TextareaPrompt — multi-line text input with line/column cursor and optional max-line cap
- Pure renderer — every method returns a new immutable instance;
view()returns ANSI strings,value()returns the data
Install
Quick Start
Text Prompt
Selection Prompt
Multi-Select Prompt
Confirmation Prompt
Key Bindings
The SugarCraft\Readline\Key class exposes symbolic constants for every supported key.
Key::Left/Key::Right— move cursor (text input)Key::Up/Key::Down— navigate selection list / change line in textareaKey::PageUp/Key::PageDown— page through long listsKey::Home/Key::End— jump within the current line / listKey::Enter— submit text or select current choiceKey::Space— toggle mark in multi-selectKey::Tab— auto-complete or toggle confirmation valueKey::Backspace/Key::Delete— delete charactersKey::CtrlU/Key::CtrlK— delete to start / end of lineKey::Escape/Key::CtrlC— abort
Submit / Abort Semantics
Each prompt is a state machine with three states: pending, submitted, aborted.
submit()finalises the prompt; forMultiSelectPromptit only succeeds whencanSubmit()is true.abort()(or feedingKey::Escape/Key::CtrlC) discards the prompt;value()/selectedValues()then return empty.isSubmitted()/isAborted()report status;currentValue()(Confirmation) andselectedValue()(Selection) reflect the current cursor regardless of submission state.
License
MIT
All versions of sugar-readline with dependencies
PHP Build Version
Package Version
No informations.
The package sugarcraft/sugar-readline contains the following files
Loading the files please wait ...