promkit 0.12.0

A toolkit for building your own interactive command-line tools
Documentation

promkit

ci docs.rs

A toolkit for building your own interactive prompt in Rust.

Getting Started

Put the package in your Cargo.toml.

[dependencies]
promkit = "0.12.0"

Features

  • Cross-platform support for both UNIX and Windows utilizing crossterm
  • Modularized architecture
    • promkit-core
      • Core functionality for terminal rendering and keyed grapheme chunk management
    • promkit-widgets
      • Various UI components (text, listbox, tree, etc.)
    • promkit
      • High-level presets and user interfaces
    • promkit-derive
      • A Derive macro that simplifies interactive form input
  • Rich preset components
    • Readline - Text input with auto-completion
    • Confirm - Yes/no confirmation prompt
    • Password - Password input with masking and validation
    • Form - Manage multiple text input fields
    • Listbox - Single selection interface from a list
    • QuerySelector - Searchable selection interface
    • Checkbox - Multiple selection checkbox interface
    • Tree - Tree display for hierarchical data like file systems
    • JSON - Parse and interactively display JSON data
    • Text - Static text display

Concept

See here.

Projects using promkit

Examples/Demos

promkit provides presets so that users can try prompts immediately without having to build complex components for specific use cases.

Show you commands, code, and actual demo screens for examples that can be executed immediately below.

Readline

cargo run --bin readline

Code

Confirm

cargo run --bin confirm

Code

Password

cargo run --bin password

Code

Form

cargo run --bin form

Code

Listbox

cargo run --bin listbox

Code

QuerySelector

cargo run --bin query_selector

Code

Checkbox

cargo run --bin checkbox

Code

Tree

cargo run --bin tree

Code

JSON

cargo run --bin json ${PATH_TO_JSON_FILE}

Code

Text

cargo run --bin text

Code

License

MIT License

Stargazers over time

Stargazers over time