zfish 0.1.10

Ultra-light, zero-dependency Rust CLI framework for building beautiful command-line applications
docs.rs failed to build zfish-0.1.10
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: zfish-0.1.8

๐ŸŸ zfish โ€” Ultra-Light CLI Framework for Rust


๐Ÿ“‹ View the full roadmap and feature status on Notion โ†’


โœจ Features

  • ๐Ÿš€ Zero Dependencies โ€” No third-party crates, only std
  • ๐ŸŽจ Rich Styling โ€” 16 ANSI colors + 256-color palette
  • โšก Blazing Fast โ€” Cold start <5ms, parse 1M flags in ~200ms
  • ๐Ÿ”’ Memory Safe โ€” #![forbid(unsafe_code)] in public API
  • ๐ŸŒ Cross-Platform โ€” Linux, macOS, Windows (tier-1 support)
  • ๐Ÿ“ฆ Lightweight โ€” Minimal binary size, fast compile times
  • ๐ŸŽฏ Intuitive API โ€” Ergonomic design, great docs
  • ๐Ÿ”ฎ Edition 2024 โ€” Built with the latest Rust features

๐ŸŽ What's Included

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


๐Ÿš€ Quick Start

Installation

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

Hello, Colorful World!

use zfish::Color;

fn main() {
    println!("{}", Color::Green.paint("โœ“ Success!"));
    println!("{}", Color::Red.paint("โœ— Error!"));
    println!("{}", Color::Yellow.paint("โš  Warning!"));
}

Argument Parsing

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);
    }
}

Progress Bar

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!");
}

Subcommands (Git-Style CLI)

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"),
    }
}

Interactive Prompts

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());
}

256-Color Palette

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!();
        }
    }
}

Beautiful Tables

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       โ”‚ โญโญโญ โ”‚
    // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
}

๐Ÿ“š Documentation

  • Developer Docs: zfish-devdocs.vercel.app โ€” Interactive guides and tutorials
  • API Docs: docs.rs/zfish โ€” Generated Rust documentation
  • Roadmap: ROADMAP.md โ€” Detailed feature roadmap
  • Public Roadmap: Notion Roadmap โ€” Live feature status & timeline
  • Installation Guide: PACKAGES.md โ€” Multiple installation methods
  • Release Process: .github/RELEASE_PROCESS.md โ€” How we create releases
  • Examples: examples/ โ€” 18 comprehensive examples covering all features
    • 01_hello_world.rs โ€” Basic usage
    • 02_argument_parsing.rs โ€” CLI argument handling
    • 03_colored_text.rs โ€” 16 + 256 color palette
    • 04_progress_bar.rs โ€” 4 progress bar styles
    • 05_logger.rs โ€” Leveled logging
    • 06_terminal_control.rs โ€” Terminal manipulation
    • 07_interactive_prompts.rs โ€” User input
    • 08_complete_cli.rs โ€” Full-featured CLI app
    • 09_subcommands.rs โ€” Nested command structures
    • 10_arg_features_v2.rs โ€” Advanced argument features
    • 11_core_features_demo.rs โ€” Core functionality showcase
    • 12_beautiful_reports.rs โ€” Styled report generation
    • 13_table_examples.rs โ€” 12 automated table examples with all box styles
    • 14_alignment_test.rs โ€” Table emoji alignment verification
    • 15_debug_emoji_width.rs โ€” Unicode width debugging
    • 16_comprehensive_unicode_test.rs โ€” Full Unicode support test
    • 17_unicode_edge_cases.rs โ€” Complex emoji sequences
    • 18_manual_table_drawing.rs โ€” Manual table fallback for custom layouts

๐ŸŽฏ Design Philosophy

Why zfish?

Most CLI frameworks pull in dozens of dependencies, increasing:

  • Compile times (minutes instead of seconds)
  • Binary size (MBs instead of KBs)
  • Supply chain risk (trust dozens of crates)
  • Maintenance burden (breaking changes cascade)

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 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Core Principles

  1. Zero Dependencies โ€” Only Rust std library
  2. Safety First โ€” No unsafe code in public API
  3. Performance โ€” Optimized for speed and size
  4. Simplicity โ€” Easy to learn, hard to misuse
  5. Cross-Platform โ€” Works everywhere Rust works

๐Ÿš€ Project Status

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 Matrix

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

Completed Features (v0.1.x - v0.2.x)

Core Styling & Colors

  • โœ… 16 standard ANSI colors
  • โœ… 256-color palette (0-255)
  • โœ… Text styling (bold, italic, underline, dim, blink, reverse, hidden, strikethrough)

Argument Parsing & Commands

  • โœ… Basic argument parser (flags, options, positional args)
  • โœ… Subcommand system (git-style, multi-level hierarchies)
  • โœ… Auto-generated --help text for all commands
  • โœ… Argument validation (required args, possible values, custom validators)
  • โœ… Advanced arg features (environment variable fallbacks, delimiters, dependencies, conflicts)
  • โœ… Variadic arguments (capture multiple values)

Progress & Interactive

  • โœ… 4 progress bar styles (bar, spinner, dots, arrows)
  • โœ… Interactive prompts (text, confirm, password)

Terminal Control

  • โœ… Terminal control (clear screen, cursor movement)
  • โœ… Terminal size detection (Windows + Unix)

Logging & Tables

  • โœ… Leveled logging (error, warn, info, debug, trace)
  • โœ… Table module with 5 box styles (Single, Double, Heavy, Rounded, ASCII)
  • โœ… Unicode-aware width calculation (emojis, CJK, combining marks)
  • โœ… Manual table drawing fallback for custom layouts
  • โœ… Column alignment (Left, Right, Center)

Development & Examples

  • โœ… Feature flags (colour, raw, progress, interactive)
  • โœ… Edition 2024 support
  • โœ… 18 comprehensive examples

Coming Next (v0.3.0+)

  • ๐Ÿ”จ Multi-select prompts (checkbox lists)
  • ๐Ÿ”จ Fuzzing tests for argument parser
  • ๐Ÿ”จ Shell completion generation (bash, zsh, fish)
  • ๐Ÿ”จ Configuration file support (TOML, JSON)
  • ๐Ÿ”จ Spinner widgets with custom animations

๐Ÿ’ก 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

๐Ÿ”ง Feature Flags

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.


๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  1. Report Bugs โ€” Open an issue with details
  2. Request Features โ€” Discuss in GitHub Discussions
  3. Submit PRs โ€” Check open issues labeled "good first issue"
  4. Improve Docs โ€” Fix typos, add examples

Documentation

Development Setup

# 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

๐Ÿ“Š Performance

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:

  • CPU: AMD Ryzen 5 3600
  • RAM: 16GB DDR4-3200
  • OS: Windows 11 / Ubuntu 22.04

๐ŸŒ Platform Support

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

๐Ÿ“œ License

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.


๐Ÿ™ Acknowledgments

Inspired by:

  • clap โ€” Excellent API design patterns
  • colored โ€” Color API inspiration
  • indicatif โ€” Progress bar concepts
  • dialoguer โ€” Interactive prompt ideas

Built with zero dependencies as a proof-of-concept that powerful CLIs don't need to pull in half of crates.io.


๐Ÿ’ฌ Community

  • GitHub Discussions โ€” Ask questions, share ideas
  • Issues โ€” Report bugs, request features
  • Twitter โ€” Follow @user_0xJeet for updates

๐Ÿ“ˆ Stargazers over time

Stargazers over time


Created with โค๏ธ by Jeet Karena

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘  zfish v0.1.10                                                โ•‘
โ•‘  Copyright ยฉ 2025 Jeet Karena                                 โ•‘
โ•‘  Licensed under MIT License                                   โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โฌ† Back to Top