Skip to main content

rtb_tui/
lib.rs

1//! Reusable TUI building blocks for RTB-built CLI tools.
2//!
3//! Three pieces:
4//!
5//! - [`Wizard`] / [`WizardStep`] — multi-step interactive form with
6//!   escape-to-back navigation, backed by [`inquire`].
7//! - [`render_table`] / [`render_json`] — uniform structured-output
8//!   helpers used by the v0.4 `rtb-cli` ops subtrees behind a global
9//!   `--output text|json` flag.
10//! - [`Spinner`] — TTY-aware progress indicator that no-ops when
11//!   stderr isn't a terminal (CI logs, MCP transports).
12//!
13//! See `docs/development/specs/2026-05-06-rtb-tui-v0.1.md` for the
14//! authoritative contract.
15
16#![forbid(unsafe_code)]
17
18mod error;
19mod render;
20mod spinner;
21mod wizard;
22
23pub use error::{RenderError, WizardError};
24pub use render::{render_json, render_table};
25pub use spinner::Spinner;
26pub use wizard::{StepOutcome, Wizard, WizardBuilder, WizardStep};
27
28/// Re-export so downstream consumers (and `WizardStep` impls) can
29/// `?`-propagate without adding `inquire` as a direct dependency.
30pub use inquire::InquireError;