CLI overview
Urushi’s CLI surface is for output that is written once and then returns control to the command. It ranges from styling one line to composing a complete result from panels, lists, tables, trees, and CLI-specific presentations.
It does not enter raw mode or install an event loop. Use
urushi-prompt when the command must ask for input, and
urushi-tui when it owns a continuously redrawn screen.
What you can build
Section titled “What you can build”For explicit coordinates, overlap, and connected lines, compose the result with
Canvas. urushi-cli adds the opinionated Summary and
Warning language; core urushi supplies the underlying styles, layout, and
components.
Run the complete CLI quickstart ↓
All of these paths produce either StyledText or a renderer-neutral View.
That keeps layout and meaning separate from the final terminal capabilities.
Choose a presentation layer, produce one shared View, then let the output destination select ANSI or plain text.
Domain-specific presentation
- dataContent and meaningText, data, and command result
- composeprocessCore urushiStyles, layout, and components
- producedataViewRenderer-neutral presentation
- resolve + renderactorOutput destinationTerminal ANSI or redirected plain text
Opinionated CLI presentation
- dataSemantic resultSummary or warning data
- presentprocessurushi-cliShared rails, glyphs, hierarchy, and roles
- producedataViewThe same renderer-neutral value
- resolve + renderactorOutput destinationTerminal ANSI or redirected plain text
Quickstart: render a result
Section titled “Quickstart: render a result”This example uses the opinionated layer to turn semantic result data into a view, then sends that view through the ordinary static-output path:
cargo new result-democd result-democargo add urushi urushi-cliuse std::io;
use urushi::ThemePreset;use urushi_cli::{CliTheme, Summary};
fn main() -> io::Result<()> { let theme = ThemePreset::get("Catppuccin Mocha") .expect("built-in theme") .theme(); let cli = CliTheme::from_theme(&theme); let view = cli.summary( &Summary::new("Build complete") .field("Target", "aarch64-apple-darwin") .field("Profile", "release") .field("Output", "target/release/app"), );
urushi::println_view(&view)}│
◇ Build complete
│ Target aarch64-apple-darwin
│ Profile release
│ Output target/release/app
The same output pipeline can render a view assembled directly from core layout primitives or from a reusable list, table, or tree presentation.
Choose the layer you need
Section titled “Choose the layer you need”Use urushi directly when the application’s structure is specific to its
domain. It supplies styles, themes, layout, components, measurement, rendering,
and standard-stream helpers without imposing a product vocabulary.
Add urushi-cli when multiple commands should share a recognizable
human-facing language. Its semantic data remains independent of color and
width, and its presentations still return ordinary View values that can be
combined with core layouts.