rskit_cli/lib.rs
1//! CLI framework: theming, structured output, progress, prompts, and signals.
2//!
3//! A parser-agnostic toolkit for building consistent command-line UX: it owns
4//! the terminal *presentation* concerns (color, glyphs, tables, status lines,
5//! progress bars), *input* (interactive prompts with a non-interactive
6//! fallback), and cooperative *cancellation*, so every rskit CLI renders and
7//! behaves the same way.
8//!
9//! # Modules
10//!
11//! - [`theme`] — visual vocabulary: semantic [`Palette`] color and [`Glyphs`]
12//! symbols, both honouring `NO_COLOR`, TTY, and UTF-8 capability.
13//! - [`render`] — structured, non-interactive display: [`OutputTable`],
14//! [`OutputKV`], the [`ErrorRenderer`]/[`ExitCode`] convention, and one-off
15//! [`StatusReporter`] feedback lines.
16//! - [`progress`] — progress bar and spinner abstractions over `indicatif`.
17//! - [`live`] — multi-region live terminal rendering ([`LiveConsole`]) for
18//! streaming several concurrent outputs as bounded tiles.
19//! - [`prompt`] — interactive prompts (line, rich raw-mode, and scripted media)
20//! with a non-interactive fallback.
21//! - [`signal`] — Ctrl+C / graceful shutdown via [`CancellationToken`].
22
23pub mod live;
24pub mod progress;
25pub mod prompt;
26pub mod render;
27pub mod signal;
28pub mod theme;
29
30pub use live::{LiveConfig, LiveConsole, RegionScreen};
31pub use progress::{MultiProgress, ProgressBar, ProgressStyle};
32pub use prompt::{
33 Capabilities, Choice, ChoiceId, Key, LineTerminal, PromptMode, Prompter, ScriptedTerminal,
34 Terminal, Validation, Validator, non_empty,
35};
36pub use render::{ErrorRenderer, ExitCode, OutputFormat, OutputKV, OutputTable, StatusReporter};
37pub use signal::{CancellationToken, on_ctrl_c};
38pub use theme::{
39 ColorChoice, Glyphs, NO_COLOR_ENV, Palette, resolve_color, resolve_color_with,
40 unicode_env_enabled,
41};
42
43#[cfg(feature = "interactive")]
44pub use prompt::RichTerminal;