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.
๐ zfish โ Ultra-Light CLI Framework for Rust
โจ 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:
[]
= "0.1.10"
Alternative: Install from GitHub Packages
Download the .crate file from GitHub Releases:
# Download the latest release
# Verify checksum (optional)
# Install from local crate
Hello, Colorful World!
use Color;
Argument Parsing
use Args;
Progress Bar
use ProgressBar;
use thread;
use Duration;
Subcommands (Git-Style CLI)
use ;
Interactive Prompts
use Prompt;
256-Color Palette
use Color;
Beautiful Tables
use ;
use Color;
๐ 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 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 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
- Zero Dependencies โ Only Rust std library
- Safety First โ No unsafe code in public API
- Performance โ Optimized for speed and size
- Simplicity โ Easy to learn, hard to misuse
- 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
--helptext 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:
[]
= "0.1"
= false # Disable all defaults
= ["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:
- Report Bugs โ Open an issue with details
- Request Features โ Discuss in GitHub Discussions
- Submit PRs โ Check open issues labeled "good first issue"
- Improve Docs โ Fix typos, add examples
Documentation
- API Documentation โ Complete API reference on docs.rs
- Developer Docs โ Interactive guides, examples, and tutorials
- Roadmap โ Feature status and upcoming releases
Development Setup
# Clone the repository
# Run tests
# Run tests (single-threaded to avoid env var conflicts)
# Build documentation
# Run examples
๐ 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
Created with โค๏ธ by Jeet Karena
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ zfish v0.1.10 โ
โ Copyright ยฉ 2025 Jeet Karena โ
โ Licensed under MIT License โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ