Skip to main content

Overview

The pkg 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 to package.toml.

Synopsis

Arguments

string[]
required
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
Package names must be in kebab-case.

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
  • Monorepo with child: owner/repo:child
    • Resolves to repository owner/repo
    • Installs only the child.yazi subdirectory
    • Package name becomes child.yazi

Installation Location

  • Plugins: ~/.config/yazi/plugins/<name>.yazi
  • Flavors: ~/.config/yazi/flavors/<name>.yazi

delete

Delete one or more packages from package.toml.

Synopsis

Arguments

string[]
required
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 in package.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

Revision hashes are shown in parentheses if available.

upgrade

Upgrade one, multiple, or all packages.

Synopsis

Arguments

string[]
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/repo or owner/repo:child)
  • rev - Git revision (commit hash) currently installed
  • hash - Content hash for verification

Cache Location

Git repositories are cached in:
The hash is computed from the repository URL to avoid conflicts.

Plugin Types

Plugins

Plugins extend Yazi functionality. A plugin package contains:
  • main.lua - Plugin entry point (required)
  • Additional .lua files (optional)
  • README.md - Documentation (optional)
  • LICENSE - License file (optional)
Installed to: ~/.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)
  • LICENSE files - License files (optional)
Installed to: ~/.config/yazi/flavors/<name>.yazi/

Monorepo Support

Yazi supports monorepos containing multiple packages. Use the :child syntax:
Each child is:
  • A subdirectory in the repository
  • Named with .yazi suffix
  • Deployed independently to the config directory

Error Handling

Commands may fail with errors:

Best Practices

Version Control

Commit package.toml to version control:
This allows you to:
  • 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:
  1. Create package structure:
  2. Develop your plugin:
  3. Test locally without adding to package.toml
  4. Publish to GitHub:
  5. Others can install with:

Environment Variables

string
Set to 1 to force ANSI color output in package operations.

Exit Codes

  • 0 - Success
  • 1 - Error (package not found, Git error, network error, etc.)

See Also