chant 0.1.1

Shell glamour - beautiful prompts and output for scripts 🪄
Documentation

What is Chant?

To chant is to speak magical words. This crate lets you speak beautifully to your users through interactive prompts and styled output.


Features

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

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

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

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

// Show a spinner while working
spin("Loading...").run(|| {
    std::thread::sleep_ms(2000);
});

CLI Usage

# Install
cargo install chant

# Use in scripts
NAME=$(chant input --prompt "Name:")
chant confirm "Deploy?" && ./deploy.sh
CHOICE=$(chant choose "dev" "staging" "prod")
chant spin "Installing..." --duration 3

Installation

cargo add chant

Ecosystem

Part of the Molten Labs open source ecosystem:

Crate Description
molten_brand Design tokens & colors
glyphs ANSI escape sequences
lacquer Terminal styling
tuyere TUI framework
scoria TUI components
chant Shell glamour (you are here)
aglow Markdown renderer
censer Pretty logging

License

MIT OR Apache-2.0