Skip to main content

Build from Source

Building Yazi from source gives you the latest unreleased changes and lets you apply custom patches.

Prerequisites

  • Rust toolchain (stable)
  • Git
  • C compiler toolchain (build-essential / base-devel / Xcode CLI tools)

Step-by-Step

1. Install the Rust Toolchain

Install rustup and stable Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustup default stable

2. Clone the Repository

Clone Yazi source
git clone https://github.com/sxyazi/yazi.git
cd yazi

3. Build in Release Mode

Compile Yazi with optimizations
cargo build --release --locked

The --locked flag ensures the Cargo.lock file is respected — this produces a reproducible build. The --release flag enables optimizations for a smaller and faster binary.

4. Install the Binaries

Copy binaries to system PATH
sudo cp target/release/yazi target/release/ya /usr/local/bin/

Two binaries are produced:

BinaryPurpose
yaziThe main file manager executable
yaCLI helper — package management, DDS communication, and utility commands

Windows-Specific Build Profile

On Windows, use a nightly MSVC toolchain for best results:

Windows build setup
rustup toolchain install nightly-msvc
rustup default nightly-msvc
cargo build --release --locked

The binaries will be at target\release\yazi.exe and target\release\ya.exe.

Debug Build

Debug build with verbose logging
YAZI_LOG=debug RUST_BACKTRACE=1 cargo build

The debug build is useful for:

  • Reporting bugs — run with YAZI_LOG=debug yazi and share the output
  • Plugin development — trace plugin events and errors
  • Understanding Yazi internals — step through the code with a debugger

Debug binaries are larger and slower — use release builds for daily use.

Updating

Pull latest and rebuild
cd yazi
git pull
cargo build --release --locked
sudo cp target/release/yazi target/release/ya /usr/local/bin/
tip

For the fastest path to the latest stable release, cargo install --force yazi-build is simpler and doesn't require cloning the repository.