$ show sxyazi/yazi
Yazi is a blazing-fast terminal file manager written in Rust, built on async I/O and a modular crate architecture. It provides a full-featured TUI with file operations (copy, move, delete, rename, trash), multi-tab support, visual mode, and extensive plugin system via Lua scripting. The architecture is event-driven with an actor model, a generic task scheduler for background operations, and a virtual filesystem abstraction supporting local, SFTP, and custom Lua backends. It includes image preview via multiple protocols (Kitty, Sixel, Chafa, etc.), clipboard integration, and a distributed data service for cross-instance communication. The codebase is highly modular with over 30 internal crates, each with a single responsibility, and demonstrates strong engineering practices including custom serialization (Wire protocol), cross-platform abstractions, and lock-free data structures. It is actively maintained with frequent commits, comprehensive CI/CD, and a detailed coding style guide (AGENTS.md).
The LLM identified 4 files worth highlighting for reuse:
A custom event system with `Event`, `ActionCow`, `Cmd`, and `Replier` types that enables type-safe, asynchronous message passing between components. It supports named arguments, priority channels, and replier-based request/response. This pattern is self-contained and could be extracted for any Rust application needing a flexible event bus.
A compact, varint-based binary serialization protocol (`Wire`) with custom `Serializer` and `Deserializer` implementations. It efficiently encodes common data types (integers, strings, URLs, etc.) and is used for IPC in the distributed data service. The implementation is self-contained and demonstrates advanced serde usage, making it reusable for any project needing a lightweight wire format.
A generic task scheduler that manages concurrent file operations, plugin execution, and background processes. It provides `TaskIn`, `TaskOut`, `TaskProg` types, priority channels, progress reporting, and cancellation. The scheduler is decoupled from specific tasks via a `Behavior` trait and could be extracted as a standalone library for managing asynchronous workloads.
A trait-based virtual filesystem engine (`Engine`) that abstracts local, SFTP, and Lua-backed filesystems. It defines operations like `read_dir`, `read`, `write`, `seek`, and `stat` with async support. The design is clean and extensible, allowing new backends to be added without modifying existing code. This pattern is reusable for any application needing a pluggable filesystem layer.