Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sxyazi/yazi/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Thepkg subcommand manages Yazi packages, including plugins and flavors. Packages are stored in ~/.config/yazi/package.toml and installed from GitHub repositories.
Synopsis
Subcommands
add
Add one or more packages topackage.toml.
Synopsis
Arguments
Packages to add in the format
owner/repo or owner/repo:child.- For simple repositories:
owner/repo.yazi - For monorepos with multiple packages:
owner/repo:package-name
Examples
Package URL Format
Packages are specified using GitHub repository paths:- Simple repository:
owner/repo- Resolves to
owner/repo.yazi - Package name becomes
repo.yazi
- Resolves to
- Monorepo with child:
owner/repo:child- Resolves to repository
owner/repo - Installs only the
child.yazisubdirectory - Package name becomes
child.yazi
- Resolves to repository
Installation Location
- Plugins:
~/.config/yazi/plugins/<name>.yazi - Flavors:
~/.config/yazi/flavors/<name>.yazi
delete
Delete one or more packages frompackage.toml.
Synopsis
Arguments
Packages to delete. Use the same format as when adding.
Examples
Behavior
- Removes package from
package.toml - Deletes package files from
~/.config/yazi/plugins/or~/.config/yazi/flavors/ - Removes package cache from
~/.local/state/yazi/packages/
install
Install all packages listed inpackage.toml.
Synopsis
Examples
Behavior
- Clones or updates Git repositories for all packages
- Extracts and deploys package files to the config directory
- Updates package metadata (revision, hash) in
package.toml - Useful after:
- Fresh Yazi installation
- Syncing config to a new machine
- Manually editing
package.toml
list
List all installed packages.Synopsis
Examples
Output Format
upgrade
Upgrade one, multiple, or all packages.Synopsis
Arguments
Packages to upgrade. If not specified, upgrades all packages.
Examples
Behavior
- Fetches latest changes from Git repositories
- Updates package files in config directory
- Updates revision hash in
package.toml - Preserves local modifications are handled by Git
Package Structure
package.toml
Packages are stored in~/.config/yazi/package.toml:
Dependency Fields
use- Package identifier (owner/repoorowner/repo:child)rev- Git revision (commit hash) currently installedhash- Content hash for verification
Cache Location
Git repositories are cached in:Plugin Types
Plugins
Plugins extend Yazi functionality. A plugin package contains:main.lua- Plugin entry point (required)- Additional
.luafiles (optional) README.md- Documentation (optional)LICENSE- License file (optional)
~/.config/yazi/plugins/<name>.yazi/
Flavors
Flavors customize Yazi appearance. A flavor package contains:flavor.toml- Theme configuration (required)tmtheme.xml- TextMate theme for syntax highlighting (optional)preview.png- Preview image (optional)README.md- Documentation (optional)LICENSEfiles - License files (optional)
~/.config/yazi/flavors/<name>.yazi/
Monorepo Support
Yazi supports monorepos containing multiple packages. Use the:child syntax:
- A subdirectory in the repository
- Named with
.yazisuffix - Deployed independently to the config directory
Error Handling
Commands may fail with errors:Best Practices
Version Control
Commitpackage.toml to version control:
- Track package changes
- Share configuration across machines
- Roll back to previous package versions
Fresh Installation
On a new machine:Regular Updates
Keep packages up to date:Testing New Packages
Test packages before committing:Package Development
To develop a package:-
Create package structure:
-
Develop your plugin:
-
Test locally without adding to
package.toml -
Publish to GitHub:
-
Others can install with:
Environment Variables
Set to
1 to force ANSI color output in package operations.Exit Codes
0- Success1- Error (package not found, Git error, network error, etc.)
See Also
- ya - Main CLI utility
- yazi - Main Yazi command
- Plugin Development Guide - Creating custom plugins
- Flavor Development Guide - Creating custom themes