← home

tui playground.

terminal tools, open source

[01] batu@batu0:~/playground

Small, sharp tools built for the terminal. Each one does one thing well and ships as a single cargo install.

tui-breath

Apr – May 2026

Terminal breathing guide. Guided inhale / hold / exhale cycles with a smooth animated circle, three patterns, and session history saved to disk.

Rust · ratatui · crossterm · tokio

install
cargo install tui_breath
uninstall
cargo uninstall tui_breath

[02] batu@batu0:~/playground/tui-breath/how-it-works

how tui-breath works

I built this because breathwork apps want to live on your phone and notify you about your mindfulness journey. I wanted something I could trigger from the same environment where I work — no ceremony, no app-switching.

How it's built

Five states: Menu → Setup → Session → Results → History, transitions enforced at compile time via exhaustive enum matching. The BreathingEngine is a Copy struct — pure computation, no I/O — so the SessionAnimator reads it as a value rather than coordinating with it.

Animation layer is hand-written: Lerp for 800ms colour crossfades, Typewriter for phase-label reveals, Pulse for hold-phase brightness. No external easing dep — that's what got cargo publish through clean on the first attempt.

Three patterns out of the box

  • 4-7-8 — inhale 4s, hold 7s, exhale 8s. Classic anxiety interrupt.
  • Box Breathing — 4-4-4-4. Used in military and athletic performance contexts.
  • Diaphragmatic — slow belly-breathing for sustained focus.

Session duration set in cycles (1–100), speed in a 0.5×–2.0× multiplier. Results and full event logs persist at ~/.local/share/tui_breath/sessions/. History screen browsable inside the app.

Source: github.com/avakado0/tui-breath


Prefer the browser? Check the web app: breath4.life ↗