Skip to main content

Command Reference

ya CLI Commands

The ya command-line tool manages packages, plugins, and IPC:

CommandDescription
ya pkgManage installed packages
ya pubPublish a package
ya pub-toPublish to a specific channel
ya emitEmit an event to a running Yazi instance
ya pack --listList installed packages
ya pack --upgradeUpgrade all packages

ya pkg Subcommands

SubcommandDescription
ya pkg --listList installed packages
ya pkg --add <url>Install a package from URL
ya pkg --remove <name>Remove a package
ya pkg --upgradeUpgrade all packages

ya emit

Send a Yazi event from the command line to a running instance:

# Emit a cd event
ya emit cd "~/projects"

# Emit a quit event
ya emit quit

This is useful for scripting Yazi from external tools.

yazi CLI Flags

FlagDescription
--cwd-file <path>Write the last-visited directory to a file on exit (used by the shell wrapper)
--clear-cacheClear the cache directory and exit
--image-protocol <proto>Override the image protocol (kitty, sixel, iterm2, uberzug++, chafa)
--debugPrint debug information
--versionShow version information
--helpShow help message

Shell Wrapper Integration

The --cwd-file flag enables the shell wrapper (y function):

# Inside your shell rc file:
y() {
local tmp="$(mktemp)"
yazi --cwd-file="$tmp" "$@"
if [ -f "$tmp" ]; then
cd "$(cat "$tmp")"
rm -f "$tmp"
fi
}

DDS Commands

DDS (Data Distribution Service) commands for multi-instance communication:

CommandDescription
ya dds pub <topic>Publish data to a topic
ya dds sub <topic>Subscribe to a topic
dds.enabled = trueEnable DDS in yazi.toml
ya emit --dds <event>Emit event to all Yazi instances via DDS

Package Management

CommandDescription
ya pack -a <user>/<package>Add/install a package
ya pack -a <user>/<package>:<branch>Install from a specific branch
ya pack -lList installed packages
ya pack -UUpgrade all packages
ya pack -u <name>Upgrade a specific package
ya pack -r <name>Remove a package

Packages are installed to ~/.config/yazi/packages/.