| Crates.io | blo_cli |
| lib.rs | blo_cli |
| version | 0.2.1 |
| created_at | 2026-01-04 21:15:06.222825+00 |
| updated_at | 2026-01-04 21:24:28.573073+00 |
| description | A simple Rust library for styling terminal text with ANSI escape codes |
| homepage | https://github.com/Blonar257/blo_cli |
| repository | https://github.com/Blonar257/blo_cli |
| max_upload_size | |
| id | 2022498 |
| size | 15,752 |
A simple Rust library for styling terminal text with ANSI escape codes.
Add the library to your project:
cargo add blo_cli
Or clone the repository and build it locally:
git clone https://github.com/Blonar257/blo_cli.git
cd blo_cli
cargo build
use blo_cli::colors::Color;
use blo_cli::colors::{fg_colorize, bg_colorize};
use blo_cli::styles::{TextStyle, style, BorderStyle, border};
fn main() {
// Color text in blue
println!("{}", fg_colorize("Hello World!", Color::Blue));
// Make text bold
println!("{}", style("Hello World!", TextStyle::Bold));
// Underline text
println!("{}", style("Hello World!", TextStyle::Underline));
// Text with angular border
println!("{}", border("Hello World!", BorderStyle::Angular, None));
// Text with rounded border in red
println!("{}", border("Hello World!", BorderStyle::Rounded, Some(Color::Red)));
}
The border() function creates a border around text:
use blo_cli::styles::{BorderStyle, border};
use blo_cli::colors::Color;
// Simple angular border (without color)
println!("{}", border("Info", BorderStyle::Angular, None));
// Rounded border in red
println!("{}", border("Warning", BorderStyle::Rounded, Some(Color::Red)));
// Multi-line text with border
println!("{}", border("Line 1\nLine 2", BorderStyle::Angular, Some(Color::Green)));
BorderStyle Options:
BorderStyle::Angular: Angular corners (┌─┐│└┘)BorderStyle::Rounded: Rounded corners (╭─╮│╰╯)Colors: All colors (Red, Green, Blue, Yellow, Pink, Cyan, White, Black) are supported.
See examples/demo.rs for more examples, including background colors and borders.
Run the tests:
cargo test
This project is licensed under the MIT License.