cliux 0.4.1

Styled terminal output made simple — boxes, sections, dividers, and emoji-aware padding for CLI tools.
Documentation

cliux

Styled terminal output made simple.

cliux is a lightweight Rust crate for formatting terminal output with clean, readable components — no TUI required. It helps CLI tools present information with structure and style using boxes, sections, dividers, lists, tags, and smart padding.

✨ Features

  • Boxed — bordered containers with titles and content
  • Section — titled blocks with horizontal dividers
  • Divider — customizable horizontal lines
  • List — bullet-pointed lists with customizable styles
  • Tag — colored tags with customizable styles
  • Padding — Unicode-aware padding (emoji-safe)

Examples

Boxed

use cliux::Boxed;

fn main() {
    Boxed::new("Cliux Boxed")
        .content("This code uses the cliux library to create a boxed section.")
        .width(61)
        .print();
}

Label

use cliux::Label;

fn main() {
    Label::new("INFO").style("info").print();
    Label::new("✓ Done").style("success").print();
    Label::new("ERROR").style("error").print();
}

Section

use cliux::Section;

fn main() {
    Section::new("Wrapped Section")
        .content("This is a long sentence that will be wrapped intelligently across multiple lines.")
        .width(40)
        .wrap(true)
        .style('')
        .print();
}

Divider

use cliux::Divider;

fn main() {
    Divider::new(30).style('=').print();
}

List

use cliux::List;

fn main() {
    List::new(vec!["First item", "Second item", "Third item"])
        .bullet("*")
        .width(40)
        .print();

    List::new(vec!["One", "Two", "Three"])
        .numbered()
        .print();
}

Tag

use cliux::Tag;

fn main() {
    Tag::new("beta").rounded().color("yellow").bold(true).print();
    Tag::new("admin").curly().color("red").print();
    Tag::new("draft").print();
}

Table

use cliux::Table;

fn main() {
    Table::new()
        .headers(&["Name", "Status"])
        .row(&["cliux", "active"])
        .row(&["other", "pending"])
        .widths(&[20, 10])
        .bordered(true)
        .print();
}

Note

use cliux::Note;

fn main() {
    Note::new("Be careful with this setting.")
        .kind("warning")
        .style("rounded")
        .width(40)
        .print();

    Note::new("Tip: You can use --force here.")
        .kind("info")
        .style("+")
        .width(40)
        .print();
}

📚 Usage

Add to your Cargo.toml:

cliux = "0.3.0"

Screenshots

Boxed

Boxed

Label

Label

Section

Section

Divider

Divider

List

List

Tag

Tag

Table

Table

Note

Note

🚧 Status

This is an early release. Components and layout may evolve. Contributions and feedback welcome!