Make interactive prompt in Rust
See the codeA toolkit for building your own interactive prompt in Rust.
Put the package in your Cargo.toml.
[dependencies]
promkit = { version = "0.17.0", features = ["runtime", "texteditor"] }
Prompt lifecycle and combine only the widget
states an application needs. Key bindings, focus, validation, background
work, and other event policy remain in the application instead of
framework-owned presets.TerminalSession.promkit-core handles
wrapping or truncation, vertical pane allocation, cursor scrolling, clipping,
resizing, and screen-to-widget hit testing.promkit-widgets provides
text editing and display, list and checkbox selection, prefix search,
spinners, trees, JSON and YAML documents, and CSV tables.See here.
promkit provides a runtime and reusable widgets for building interactive terminal applications. The examples own their event policies and demonstrate how applications can compose the widgets they need.
| Example | Description |
|---|---|
| Readline | Single-line editing with history and completion |
| Confirm | Validated yes-or-no input |
| Password | Masked input with validation |
| Form | Multiple editable fields in one prompt |
| Listbox | Keyboard-driven single selection |
| QuerySelector | Prefix search over selectable candidates |
| Checkbox | Keyboard-driven multiple selection |
| Tree | Navigation and folding for hierarchical data |
| JSON | Line-numbered navigation and folding for JSON |
| YAML | Line-numbered navigation and folding for YAML |
| CSV | Vertical and horizontal navigation for tabular data |
| Text | Scrollable styled text |
| Async Task with Spinner | Background work with live input and progress feedback |
| Multiline REPL | Multiline editing in an interactive loop |
Each section includes a command, source link, and recorded demo.
cargo run --bin readline
cargo run --bin confirm
cargo run --bin password
cargo run --bin form
cargo run --bin listbox
cargo run --bin query-selector
cargo run --bin checkbox
cargo run --bin tree
cargo run --bin json ${PATH_TO_JSON_FILE}
cargo run --bin yaml ${PATH_TO_YAML_FILE}
cargo run --bin csv ${PATH_TO_CSV_FILE}
cargo run --bin text
These examples demonstrate how to compose widgets and rendering primitives for application-specific event loops and asynchronous workflows.
cargo run --bin async_task
cargo run --bin repl
Rust
99.1%
Make interactive prompt in Rust
See the codeA toolkit for building your own interactive prompt in Rust.
Put the package in your Cargo.toml.
[dependencies]
promkit = { version = "0.17.0", features = ["runtime", "texteditor"] }
Prompt lifecycle and combine only the widget
states an application needs. Key bindings, focus, validation, background
work, and other event policy remain in the application instead of
framework-owned presets.TerminalSession.promkit-core handles
wrapping or truncation, vertical pane allocation, cursor scrolling, clipping,
resizing, and screen-to-widget hit testing.promkit-widgets provides
text editing and display, list and checkbox selection, prefix search,
spinners, trees, JSON and YAML documents, and CSV tables.See here.
promkit provides a runtime and reusable widgets for building interactive terminal applications. The examples own their event policies and demonstrate how applications can compose the widgets they need.
| Example | Description |
|---|---|
| Readline | Single-line editing with history and completion |
| Confirm | Validated yes-or-no input |
| Password | Masked input with validation |
| Form | Multiple editable fields in one prompt |
| Listbox | Keyboard-driven single selection |
| QuerySelector | Prefix search over selectable candidates |
| Checkbox | Keyboard-driven multiple selection |
| Tree | Navigation and folding for hierarchical data |
| JSON | Line-numbered navigation and folding for JSON |
| YAML | Line-numbered navigation and folding for YAML |
| CSV | Vertical and horizontal navigation for tabular data |
| Text | Scrollable styled text |
| Async Task with Spinner | Background work with live input and progress feedback |
| Multiline REPL | Multiline editing in an interactive loop |
Each section includes a command, source link, and recorded demo.
cargo run --bin readline
cargo run --bin confirm
cargo run --bin password
cargo run --bin form
cargo run --bin listbox
cargo run --bin query-selector
cargo run --bin checkbox
cargo run --bin tree
cargo run --bin json ${PATH_TO_JSON_FILE}
cargo run --bin yaml ${PATH_TO_YAML_FILE}
cargo run --bin csv ${PATH_TO_CSV_FILE}
cargo run --bin text
These examples demonstrate how to compose widgets and rendering primitives for application-specific event loops and asynchronous workflows.
cargo run --bin async_task
cargo run --bin repl
Rust
99.1%