Minimal, (mostly) zero-dependency Rust crates for focused applications.
A collection of tiny, focused Rust crates built on the standard library alone. Each one does one thing well and keeps its dependency count at zero. The one exception is nanologger, whose only dependencies are two other nano crates β nanocolor and nanotime β keeping the family entirely self-contained. nanoargs also optionally depends on nanocolor for colored help output via a cargo feature.
| Crate | Description | Version | GitHub | Coverage |
|---|---|---|---|---|
| π nanoargs | Argument parser | Repo | ||
| πͺ΅ nanologger | Colored, leveled logger | Repo | ||
| π¨ nanocolor | Terminal colors and styles | Repo | ||
| β nanoprogress | Progress bars | Repo | ||
| β nanospinner | Terminal spinners | Repo | ||
| β± nanotime | Time utilities | Repo |
A lightweight, zero-dependency argument parser for Rust
GitHub Β· crates.io Β· docs.rs
Flags, options, subcommands, help generation, env fallback, and typed parsing β everything you'd reach for clap for in a typical CLI, with zero dependencies.
Install:
cargo add nanoargsDependencies: 0 (only std; optional color feature adds nanocolor)
use nanoargs::{ArgBuilder, Flag, Opt, Pos, ParseError};
fn main() {
let parser = ArgBuilder::new()
.name("myapp")
.description("A sample CLI tool")
.flag(Flag::new("verbose").desc("Enable verbose output").short('v'))
.option(Opt::new("output").placeholder("FILE").desc("Output file path"))
.positional(Pos::new("input").desc("Input file").required())
.build()
.unwrap();
let args: Vec<String> = std::env::args().skip(1).collect();
match parser.parse(args) {
Ok(result) => {
println!("verbose: {}", result.get_flag("verbose"));
println!("output: {:?}", result.get_option("output"));
println!("input: {:?}", result.get_positionals());
}
Err(ParseError::HelpRequested(text)) => print!("{}", text),
Err(ParseError::VersionRequested(text)) => println!("{}", text),
Err(e) => eprintln!("error: {}", e),
}
}A minimal logger for Rust.
GitHub Β· crates.io Β· docs.rs
Colored, leveled logging to stderr with format!-style macros, optional timestamps, source locations, thread info, module filtering, file logging, and log facade integration.
Install:
cargo add nanologgerDependencies: 2 β nanocolor and nanotime (both nano family crates)
β οΈ nanologger is the only crate in the family that is not zero-dependency. Its only dependencies are two other nano crates, keeping the family self-contained.
use nanologger::{LoggerBuilder, LogLevel};
fn main() {
LoggerBuilder::new()
.level(LogLevel::Trace)
.timestamps(true)
.init()
.unwrap();
nanologger::error!("something went wrong: {}", "disk full");
nanologger::warn!("retries remaining: {}", 3);
nanologger::info!("server started on port {}", 8080);
}A minimal, zero-dependency terminal color and text styling crate for Rust
GitHub Β· crates.io Β· docs.rs
ANSI 16-color support and common text styles through a chainable trait-based API β under 300 lines of code.
Install:
cargo add nanocolorDependencies: 0 (only std)
use nanocolor::Colorize;
fn main() {
println!("{}", "error".red().bold());
println!("{}", "warning".yellow());
println!("{}", "success".green().on_black().underline());
}A minimal, zero-dependency terminal progress bar for Rust applications
GitHub Β· crates.io Β· docs.rs
Lightweight determinate progress bar β under 300 lines of code. Thread-safe, customizable width/fill/empty chars.
Install:
cargo add nanoprogressDependencies: 0 (only std)
use nanoprogress::ProgressBar;
use std::thread;
use std::time::Duration;
fn main() {
let bar = ProgressBar::new(100)
.message("Downloading...")
.start();
for _ in 0..100 {
thread::sleep(Duration::from_millis(30));
bar.tick(1);
}
bar.success("Download complete");
}A minimal, zero-dependency terminal spinner for Rust applications
GitHub Β· crates.io Β· docs.rs
Lightweight animated spinner using only the Rust standard library β under 200 lines of code.
Install:
cargo add nanospinnerDependencies: 0 (only std)
use nanospinner::Spinner;
use std::thread;
use std::time::Duration;
fn main() {
let handle = Spinner::new("Loading...").start();
thread::sleep(Duration::from_secs(2));
handle.success();
}A minimal, zero-dependency time utility crate for Rust applications
GitHub Β· crates.io Β· docs.rs
Local and UTC time retrieval, nanosecond-precision timestamps, human-readable formatting, relative time strings, and lightweight elapsed duration measurement.
Install:
cargo add nanotimeDependencies: 0 (only std + raw FFI)
use nanotime::{NanoTime, Elapsed};
fn main() {
let now = NanoTime::now();
println!("Local time: {}", now);
println!("UTC: {}", NanoTime::now_utc().datetime());
let timer = Elapsed::start();
// ... do some work ...
println!("Took {}", timer);
}[dependencies]
nanoargs = "0.1"
nanologger = "0.1"
nanocolor = "0.1"
nanoprogress = "0.1"
nanospinner = "0.1"
nanotime = "0.1"Contributions are welcome! Please see CONTRIBUTING.md for guidelines on reporting issues, suggesting new crates, and contributing to existing ones.
This project is licensed under the MIT License β see the LICENSE file for details.