| Crates.io | zfish |
| lib.rs | zfish |
| version | 0.1.10 |
| created_at | 2025-10-27 07:19:40.9054+00 |
| updated_at | 2025-10-31 18:33:25.539607+00 |
| description | Ultra-light, zero-dependency Rust CLI framework for building beautiful command-line applications |
| homepage | https://github.com/JeetKarena/ZFish |
| repository | https://github.com/JeetKarena/ZFish.git |
| max_upload_size | |
| id | 1902390 |
| size | 412,716 |
Soar above the complexity
std#![forbid(unsafe_code)] in public API| Component | Description | Examples |
|---|---|---|
| Colors | 16 ANSI + 256-color palette, 8 text styles | Color::Red.paint("text") |
| Args | Flag parsing, options, positional arguments | --verbose, -abc, file.txt |
| Commands | Git-style subcommands with auto-help | app init, app build --release |
| Progress | 4 bar styles (bar, spinner, dots, arrows) | Loading, downloading, processing |
| Tables | 5 box styles, alignment, Unicode-aware | Data display, reports, grids |
| Prompts | Text input, password, confirm dialogs | Interactive CLIs, wizards |
| Logging | 5 levels (error โ trace), timestamps | Debug output, application logs |
| Terminal | Clear, cursor control, size detection | TUI helpers, screen management |
๐ See the Feature Matrix below for detailed capabilities
Add zfish to your Cargo.toml:
[dependencies]
zfish = "0.1.10"
Alternative: Install from GitHub Packages
Download the .crate file from GitHub Releases:
# Download the latest release
wget https://github.com/JeetKarena/ZFish/releases/download/v0.1.10/zfish-0.1.10.crate
# Verify checksum (optional)
wget https://github.com/JeetKarena/ZFish/releases/download/v0.1.10/zfish-0.1.10.crate.sha256
sha256sum -c zfish-0.1.10.crate.sha256
# Install from local crate
cargo install --path zfish-0.1.10.crate
use zfish::Color;
fn main() {
println!("{}", Color::Green.paint("โ Success!"));
println!("{}", Color::Red.paint("โ Error!"));
println!("{}", Color::Yellow.paint("โ Warning!"));
}
use zfish::Args;
fn main() {
let args = Args::parse();
if args.has_flag("verbose") || args.has_flag("v") {
println!("Verbose mode enabled");
}
if let Some(file) = args.get_option("file") {
println!("Processing: {}", file);
}
for arg in &args.positional {
println!("Positional argument: {}", arg);
}
}
use zfish::ProgressBar;
use std::thread;
use std::time::Duration;
fn main() {
let mut pb = ProgressBar::new(100);
for i in 0..=100 {
pb.set(i);
thread::sleep(Duration::from_millis(50));
}
pb.finish("โ Complete!");
}
use zfish::command::{App, Command, Arg};
fn main() {
let app = App::new("myapp")
.version("1.0.0")
.about("My awesome CLI")
.arg(Arg::new("verbose").short('v').long("verbose"))
.subcommand(
Command::new("init")
.about("Initialize a new project")
.arg(Arg::new("name").required(true))
)
.subcommand(
Command::new("build")
.about("Build the project")
.arg(Arg::new("release").long("release"))
);
let matches = app.get_matches();
match matches.subcommand() {
Some(("init", sub_matches)) => {
let name = sub_matches.value_of("name").unwrap();
println!("Initializing: {}", name);
}
Some(("build", sub_matches)) => {
if sub_matches.is_present("release") {
println!("Building in release mode");
}
}
_ => println!("Use --help for usage"),
}
}
use zfish::Prompt;
fn main() {
let name = Prompt::text("What's your name?");
println!("Hello, {}!", name);
if Prompt::confirm("Continue?") {
println!("Let's go!");
}
let password = Prompt::password("Enter password:");
println!("Password length: {}", password.len());
}
use zfish::Color;
fn main() {
// Use any color from 0-255
println!("{}", Color::Custom(196).paint("Bright red"));
println!("{}", Color::Custom(46).paint("Bright green"));
println!("{}", Color::Custom(21).paint("Deep blue"));
// Show all 256 colors
for i in 0..=255 {
print!("{} ", Color::Custom(i).paint(format!("{:3}", i)));
if (i + 1) % 16 == 0 {
println!();
}
}
}
use zfish::table::{Table, BoxStyle, Alignment};
use zfish::Color;
fn main() {
let mut table = Table::new(vec!["Name", "Language", "Stars"]);
table.set_box_style(BoxStyle::Rounded);
table.set_column_alignment(2, Alignment::Right);
table.add_row(vec!["zfish", "Rust", "โญโญโญโญโญ"]);
table.add_row(vec!["clap", "Rust", "โญโญโญโญ"]);
table.add_row(vec!["cobra", "Go", "โญโญโญ"]);
table.print();
// Output:
// โญโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโฎ
// โ Name โ Language โ Stars โ
// โโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโค
// โ zfish โ Rust โ โญโญโญโญโญ โ
// โ clap โ Rust โ โญโญโญโญ โ
// โ cobra โ Go โ โญโญโญ โ
// โฐโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโฏ
}
01_hello_world.rs โ Basic usage02_argument_parsing.rs โ CLI argument handling03_colored_text.rs โ 16 + 256 color palette04_progress_bar.rs โ 4 progress bar styles05_logger.rs โ Leveled logging06_terminal_control.rs โ Terminal manipulation07_interactive_prompts.rs โ User input08_complete_cli.rs โ Full-featured CLI app09_subcommands.rs โ Nested command structures10_arg_features_v2.rs โ Advanced argument features11_core_features_demo.rs โ Core functionality showcase12_beautiful_reports.rs โ Styled report generation13_table_examples.rs โ 12 automated table examples with all box styles14_alignment_test.rs โ Table emoji alignment verification15_debug_emoji_width.rs โ Unicode width debugging16_comprehensive_unicode_test.rs โ Full Unicode support test17_unicode_edge_cases.rs โ Complex emoji sequences18_manual_table_drawing.rs โ Manual table fallback for custom layoutsMost CLI frameworks pull in dozens of dependencies, increasing:
zfish takes a different approach:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Other CLI Frameworks โ zfish โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 50+ dependencies โ 0 dependencies โ
โ ~10 second compile โ ~1 second compile โ
โ ~2 MB binary โ ~200 KB binary โ
โ Complex API โ Intuitive API โ
โ ANSI escape codes manual โ Auto color detection โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Current Version: 0.1.10 (Active Development)
๐ For detailed feature status, implementation notes, and roadmap, visit our Notion Roadmap โ
See ROADMAP.md for version plans.
| Feature Category | Feature | Status | Module | Notes |
|---|---|---|---|---|
| Colors & Styling | 16 ANSI Colors | โ | style |
Black, Red, Green, Yellow, Blue, Magenta, Cyan, White + Bright variants |
| 256-Color Palette | โ | style |
Color::Custom(0-255) |
|
| Text Styles | โ | style |
Bold, Italic, Underline, Dim, Blink, Reverse, Hidden, Strikethrough | |
| Chained Styling | โ | style |
.style(Style::Bold).style(Style::Italic) |
|
| Argument Parsing | Flags & Options | โ | args |
--flag, -f, --option value |
| Positional Args | โ | args |
Automatic capture of non-flag arguments | |
| Short Flag Combos | โ | args |
-abc โ -a -b -c |
|
| Commands & Subcommands | Subcommand System | โ | command |
Git-style nested commands |
| Auto-generated Help | โ | command |
--help for all commands |
|
| Argument Validation | โ | command |
Required args, possible values, custom validators | |
| Environment Fallbacks | โ | command |
.env("VAR_NAME") for options |
|
| Value Delimiters | โ | command |
--tags rust,cli,tool |
|
| Argument Dependencies | โ | command |
.requires("other_arg") |
|
| Conflict Detection | โ | command |
.conflicts_with("other_arg") |
|
| Variadic Arguments | โ | command |
[FILES]... capture multiple values |
|
| Command Aliases | โ | command |
Multiple names for same command | |
| Progress Bars | Bar Style | โ | progress |
Classic progress bar |
| Spinner Style | โ | progress |
Rotating spinner | |
| Dots Style | โ | progress |
Animated dots | |
| Arrow Style | โ | progress |
Moving arrows | |
| Custom Width | โ | progress |
.width(50) |
|
| Interactive Prompts | Text Input | โ | prompt |
Prompt::text("Question?") |
| Password Input | โ | prompt |
Hidden input for sensitive data | |
| Confirmation | โ | prompt |
Yes/No prompts | |
| Multi-select | ๐จ | - | Coming in v0.3.0 | |
| Tables | 5 Box Styles | โ | table |
Single, Double, Heavy, Rounded, ASCII |
| Column Alignment | โ | table |
Left, Right, Center per column | |
| Unicode-Aware Width | โ | table |
Handles emojis, CJK, combining marks | |
| Header/Footer Separators | โ | table |
Toggle separators on/off | |
| Manual Drawing | โ | table |
draw_box(), draw_separator() for custom layouts |
|
| Custom Indentation | โ | table |
.set_indent(n) |
|
| Logging | 5 Log Levels | โ | log |
Error, Warn, Info, Debug, Trace |
| Timestamp Support | โ | log |
Optional timestamps | |
| Level Filtering | โ | log |
.level(Level::Debug) |
|
| Terminal Control | Clear Screen | โ | term |
Terminal::clear_screen() |
| Cursor Movement | โ | term |
Terminal::move_cursor(row, col) |
|
| Terminal Size | โ | term |
Terminal::size() (cross-platform) |
|
| Print at Position | โ | term |
Terminal::print_at(row, col, text) |
|
| Platform Support | Linux | โ | os |
Tier 1 support |
| macOS | โ | os |
Tier 1 support | |
| Windows | โ | os |
Tier 1 support (cmd.exe, PowerShell) | |
| BSD | ๐ก | os |
Should work, not officially tested | |
| Development | Zero Dependencies | โ | - | Only uses Rust std library |
| No Unsafe Code | โ | - | #![forbid(unsafe_code)] in public API |
|
| Edition 2024 | โ | - | Uses latest Rust features | |
| Feature Flags | โ | - | colour, raw, progress, interactive |
Legend: โ Implemented | ๐จ In Progress | ๐ก Partial/Untested | โ Not Available
--help text for all commands๐ก Want more details? Check our Interactive Roadmap on Notion for:
- Detailed implementation notes for each feature
- Release timelines and version planning
- Known issues and workarounds
- Feature request voting and discussions
zfish uses Cargo feature flags for optional functionality:
[dependencies.zfish]
version = "0.1"
default-features = false # Disable all defaults
features = ["colour"] # Enable only what you need
| Flag | Default | Description | Status |
|---|---|---|---|
colour |
โ | ANSI color support (16 + 256 colors) | โ Available |
raw |
โ | Raw terminal mode for advanced I/O | โ Available |
progress |
โ | Progress bars (4 styles: bar, spinner, dots, arrows) | โ Available |
interactive |
โ | Interactive prompts (text, password, confirm) | โ Available |
Note: progress and interactive features require raw mode and are automatically enabled when you use them.
Contributions are welcome! Here's how you can help:
# Clone the repository
git clone https://github.com/JeetKarena/ZFish.git
cd zfish
# Run tests
cargo test
# Run tests (single-threaded to avoid env var conflicts)
cargo test -- --test-threads=1
# Build documentation
cargo doc --open
# Run examples
cargo run --example 01_hello_world
cargo run --example 02_argument_parsing
cargo run --example 03_colored_text
cargo run --example 04_progress_bar
cargo run --example 05_logger
cargo run --example 06_terminal_control
cargo run --example 07_interactive_prompts
cargo run --example 08_complete_cli
zfish is designed for speed:
| Operation | Time (Ryzen 3600) |
|---|---|
| Cold start | ~3ms |
| Parse 1M flags | ~180ms |
| Render progress bar | 60 FPS |
| Color detection | <1ยตs (cached) |
Benchmarks run on:
| Platform | Status | Notes |
|---|---|---|
| Linux | โ Tier 1 | Tested on Ubuntu 20.04+ |
| macOS | โ Tier 1 | Tested on macOS 12+ |
| Windows | โ Tier 1 | Tested on Windows 10/11 |
| BSD | ๐ก Should work | Not officially tested |
| WASM | โ Not supported | Terminal I/O not available |
Licensed under the MIT License.
See LICENSE for details or visit http://opensource.org/licenses/MIT.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in zfish shall be licensed under the MIT License, without any additional terms or conditions.
Inspired by:
Built with zero dependencies as a proof-of-concept that powerful CLIs don't need to pull in half of crates.io.
Created with โค๏ธ by Jeet Karena
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ zfish v0.1.10 โ
โ Copyright ยฉ 2025 Jeet Karena โ
โ Licensed under MIT License โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ