Crate chant

Crate chant 

Source
Expand description

§Rune

Shell glamour - beautiful prompts and styled output for shell scripts.

Rune is the Rust equivalent of gum from Charmbracelet. It provides easy-to-use functions for interactive shell scripts and beautiful terminal output.

§Features

  • Input - Get user input with style
  • Confirm - Yes/no confirmations
  • Choose - Select from a list
  • Filter - Fuzzy search through options
  • Spin - Show loading spinners
  • Style - Style arbitrary text

§Quick Start

use rune::{input, confirm, choose, spin};

// Get user input
let name = input("What's your name?").run();

// Confirm an action
if confirm("Continue?").run() {
    // ...
}

// Choose from options
let choice = choose(&["Option A", "Option B", "Option C"]).run();

// Show a spinner while working
spin("Loading...").run(|| {
    // do work...
});

Modules§

prelude
Prelude for convenient imports.

Structs§

Choose
Selection prompt builder.
Confirm
Confirmation prompt builder.
Filter
Filter prompt builder.
Input
Text input builder.
Spin
Spinner builder.
StyleCmd
Style command builder.

Functions§

choose
Create a selection prompt.
confirm
Create a confirmation prompt.
filter
Create a filter prompt.
input
Create an input prompt.
spin
Create a spinner.
style_text
Style text with glyphs.