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