console-rs/console
console-rs/console has 1,202 GitHub stars and 150 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-09 08:28 UTC. Last push 2026-11-02.
A rust console and terminal abstraction
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalconsole
console is a library for Rust that provides access to various terminal features so you can build nicer looking command line interfaces. It comes with various tools and utilities for working with Terminals and formatting text.
Best paired with other libraries in the family:
Terminal Access
The terminal is abstracted through the console::Term type. It can
either directly provide access to the connected terminal or by buffering
up commands. A buffered terminal will however not be completely buffered
on windows where cursor movements are currently directly passed through.
Example usage:
use std::thread;
use std::time::Duration;
use console::Term;
let term = Term::stdout();
term.write_line("Hello World!")?;
thread::sleep(Duration::from_millis(2000));
term.clear_line()?;
Colors and Styles
console automatically detects when to use colors based on the tty flag, following the
clicolors standard for color enabling/disabling. It also
provides higher level wrappers for styling text and other things that can be
displayed with the style function and utility types.
Example usage:
use console::style;
println!("This is {} neat", style("quite").cyan());
You can also store styles and apply them to text later:
use console::Style;
let cyan = Style::new().cyan();
println!("This is {} neat", cyan.apply_to("quite"));
Working with ANSI Codes
The crate provides the function strip_ansi_codes to remove ANSI codes
from a string as well as measure_text_width to calculate the width of a
string as it would be displayed by the terminal. Both of those together
are useful for more complex formatting.
Unicode Width Support
By default this crate depends on the unicode-width crate to calculate
the width of terminal characters. If you do not need this you can disable
the unicode-width feature which will cut down on dependencies.
License: MIT
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
561,315 starspublic-apis/public-apis
A collective list of free APIs
497,558 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
446,414 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,244 stars