molten_rune

Crates.iomolten_rune
lib.rsmolten_rune
version0.1.0
created_at2025-12-14 18:55:29.683275+00
updated_at2025-12-14 18:55:29.683275+00
descriptionShell glamour - beautiful prompts and output for scripts 🪄
homepagehttps://molten.dev
repositoryhttps://github.com/moltenlabs/molten-rune
max_upload_size
id1984929
size70,550
Chris Mathew (chriscmathew-dorsia)

documentation

https://docs.rs/molten_rune

README

Rune

🪄 Rune

Shell glamour - beautiful prompts and output for scripts.

Crates.io Documentation CI License

FeaturesInstallationUsageCLI


What is Rune?

Rune is the Rust equivalent of gum from Charmbracelet. It provides beautiful interactive prompts and styled output for shell scripts and CLI applications.

Rune Demo


Features

📝 Input

Get text input with style.

use rune::input;

let name = input("What's your name?")
    .placeholder("Enter name...")
    .default("World")
    .run();

println!("Hello, {}!", name);

✅ Confirm

Yes/no confirmations.

use rune::confirm;

if confirm("Continue?")
    .default(true)
    .run() 
{
    println!("Proceeding...");
}

📋 Choose

Select from a list.

use rune::choose;

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

if let Some(c) = choice {
    println!("You chose: {}", c);
}

🔍 Filter

Fuzzy search through options.

use rune::filter;

let result = filter(&[
    "apple", "banana", "cherry",
    "date", "elderberry",
])
.header("Search fruits:")
.limit(5)
.run();

🔄 Spin

Show spinners while working.

use rune::spin;

spin("Loading data...")
    .run(|| {
        // Do work here
        std::thread::sleep_ms(2000);
    });
// ✓ Loading data...

🎨 Style

Style arbitrary text.

use rune::style_text;
use lacquer::Border;

style_text("Hello!")
    .foreground_hex("#F97316")
    .bold()
    .padding(1, 2)
    .border(Border::Rounded)
    .print();

Installation

As a library

cargo add rune

As a CLI tool

cargo install rune

CLI Usage

Rune also works as a standalone CLI tool for shell scripts:

Input

NAME=$(rune input --prompt "Name:" --placeholder "Enter name...")
echo "Hello, $NAME"

Confirm

if rune confirm "Deploy to production?"; then
    ./deploy.sh
fi

Choose

CHOICE=$(rune choose "Development" "Staging" "Production" --header "Select environment:")
echo "Deploying to $CHOICE"

Filter

FILE=$(rune filter *.rs --header "Select a file:")
code "$FILE"

Spin

rune spin "Installing dependencies..." --duration 5

Style

rune style "Success!" --foreground "#10B981" --bold
rune style "Warning" --foreground "#F59E0B" --border rounded --padding "1,2"

Shell Script Example

#!/bin/bash

# Welcome message
rune style "🪄 Setup Wizard" --foreground "#F97316" --bold

# Get project name
PROJECT=$(rune input --prompt "Project name:" --placeholder "my-project")

# Choose template
TEMPLATE=$(rune choose "web" "cli" "library" --header "Select template:")

# Confirm
if rune confirm "Create $PROJECT using $TEMPLATE template?"; then
    rune spin "Creating project..." --duration 2
    rune style "✓ Project created!" --foreground "#10B981" --bold
else
    rune style "Cancelled" --foreground "#EF4444"
fi

API Reference

Input

input("Prompt")
    .placeholder("hint")      // Placeholder text
    .default("value")         // Default value
    .password()               // Hide input
    .char_limit(100)          // Max characters
    .header("Header")         // Header text
    .run()

Confirm

confirm("Question?")
    .default(true)            // Default answer
    .affirmative("Yes")       // Yes text
    .negative("No")           // No text
    .run()

Choose

choose(&options)
    .header("Title")          // Header text
    .cursor("> ")             // Selection cursor
    .limit(10)                // Visible items
    .run()

Filter

filter(&options)
    .header("Search")         // Header text
    .placeholder("Type...")   // Input placeholder
    .limit(10)                // Visible items
    .run()

Spin

spin("Message")
    .style(SpinnerStyle::Dots)  // Spinner style
    .color(Color::Cyan)         // Spinner color
    .run(|| { /* work */ })

Ecosystem

Rune is part of the Molten Labs open source ecosystem:

Crate Description
molten_brand Design tokens & colors
glyphs ANSI escape sequences
lacquer Terminal styling
cauldron TUI framework
sparks TUI components
rune Shell glamour (you are here)
ember Markdown renderer
smelt Pretty logging

Why "Rune"?

Runes are ancient symbols of magic and power. With Rune, you inscribe beautiful, interactive spells into your shell scripts. 🪄


Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.


License

Licensed under either of:

at your option.


Built with 🪄 by Molten Labs

Commit count: 0

cargo fmt