rskit-cli — CLI Framework
Parser-agnostic CLI UX toolkit: theming, structured output, progress, interactive prompts, and signal handling.
Modules
theme— visual vocabulary:Palettesemantic color andGlyphsstatus symbols (✓ ✗ ⚠ ℹ • → …), both honouringNO_COLOR, TTY detection, and UTF-8 capability (with a pure-ASCII glyph fallback).render— structured, non-interactive display:OutputTable,OutputKV, theErrorRenderer/ExitCodeconvention, and one-offStatusReporterfeedback lines (success/warn/step/heading) for guided flows.progress—ProgressBar/MultiProgresspreset styles (Bar, Spinner, Download, Finished) overindicatif.prompt— interactive prompts (select,multi_select,confirm,text/text_with) that speak through aTerminalseam: a line-driven numbered list over pipes, a rich raw-mode arrow-key widget on a TTY (radio◉/○and checkbox[x]/[ ]lists, behind theinteractivefeature), or a scripted double in tests — with a non-interactive fallback that resolves to declared defaults and never hangs.signal—CancellationTokencooperative Ctrl+C handling for async tasks.
Features
interactive(off by default) — rich, raw-mode prompts with arrow-key navigation viacrossterm. The line-driven prompt path is always available and dependency-free, so enable this only when you want the live TUI experience.
Usage
[]
= "0.2.0-alpha.2"
use ;
use ;
let error = new;
let = new.render;
assert!;
assert_eq!;
assert_eq!;
use ;
use Duration;
async
use ;
// Bind a scripted terminal for a deterministic example; real programs use
// `Prompter::from_env(color)`, which auto-selects a rich raw-mode terminal on a
// TTY (with the `interactive` feature) or a line terminal otherwise.
let mut prompter = new;
let choice = prompter.select.expect;
assert_eq!;