tuyere

Crates.iotuyere
lib.rstuyere
version0.1.0
created_at2025-12-14 19:06:55.264696+00
updated_at2025-12-14 19:06:55.264696+00
descriptionA powerful TUI framework based on The Elm Architecture 🔮
homepagehttps://molten.dev
repositoryhttps://github.com/moltenlabs/tuyere
max_upload_size
id1984937
size51,368
Chris Mathew (chriscmathew-dorsia)

documentation

https://docs.rs/tuyere

README

🔮 Tuyere

A powerful TUI framework based on The Elm Architecture.

Crates.io Documentation License


What is Tuyere?

A tuyere is the nozzle that feeds air into a forge, bringing it to life. This crate does the same for your terminal apps—feeding events through the Elm Architecture to create beautiful, reactive TUIs.

use tuyere::{App, Model, Command, Event, Key};

struct Counter { count: i32 }

enum Msg { Increment, Decrement, Quit }

impl Model for Counter {
    type Message = Msg;

    fn update(&mut self, msg: Msg) -> Command<Msg> {
        match msg {
            Msg::Increment => self.count += 1,
            Msg::Decrement => self.count -= 1,
            Msg::Quit => return Command::quit(),
        }
        Command::none()
    }

    fn view(&self) -> String {
        format!("Count: {}\n\nPress +/- to change, q to quit", self.count)
    }

    fn handle_event(&self, event: Event) -> Option<Msg> {
        match event {
            Event::Key(Key::Char('+')) => Some(Msg::Increment),
            Event::Key(Key::Char('-')) => Some(Msg::Decrement),
            Event::Key(Key::Char('q')) => Some(Msg::Quit),
            _ => None,
        }
    }
}

fn main() {
    App::new(Counter { count: 0 }).run().unwrap();
}

Features

  • 🏗️ Elm Architecture - Model, Message, Update, View
  • Simple API - Just implement Model and you're done
  • 🖱️ Input Handling - Keyboard, mouse, focus events
  • 🎨 Styling - Works with glyphs and lacquer

Installation

cargo add tuyere

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 (you are here)
scoria TUI components
chant Shell glamour
aglow Markdown renderer
censer Pretty logging

License

MIT OR Apache-2.0

Built with 🔮 by Molten Labs

Commit count: 0

cargo fmt