Skip to main content

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

ya is a command-line utility for interacting with running Yazi instances. It provides commands for sending actions, publishing messages, subscribing to events, and managing packages.

Synopsis

ya [OPTIONS] <COMMAND>

Options

-V, --version
boolean
default:"false"
Print version information and exit.
ya --version
# Output: Ya 0.x.x (commit-hash build-date)

Commands

emit

Emit a command to be executed by the current instance.
ya emit <NAME> [ARGS]...
See emit command documentation for details.

emit-to

Emit a command to be executed by a specific instance.
ya emit-to <RECEIVER> <NAME> [ARGS]...
See emit command documentation for details.

pkg

Manage packages (plugins and flavors).
ya pkg <SUBCOMMAND>
Available subcommands:
  • add - Add packages
  • delete - Delete packages
  • install - Install all packages
  • list - List all packages
  • upgrade - Upgrade packages
See package command documentation for details.

pub

Publish a message to the current instance.
ya pub <KIND> [OPTIONS]
See pub-sub documentation for details.

pub-to

Publish a message to a specific instance.
ya pub-to <RECEIVER> <KIND> [OPTIONS]
See pub-sub documentation for details.

sub

Subscribe to messages from all remote instances.
ya sub <KINDS>
See pub-sub documentation for details.

Examples

Quick Command Execution

# Navigate to parent directory
ya emit leave

# Refresh the file list
ya emit refresh

# Search for files
ya emit search --args="*.txt"

Instance Communication

# Send command to specific instance
ya emit-to 12345 cd --args="/home/user/Downloads"

# Publish message to specific instance
ya pub-to 12345 my-event --str="Hello from another instance"

Package Management

# List installed packages
ya pkg list

# Add a new plugin
ya pkg add yazi-rs/plugins:git

# Upgrade all packages
ya pkg upgrade

Environment Variables

ya uses the following environment variables:
  • YAZI_ID / YAZI_PID - Instance ID for the current Yazi instance (set automatically)
  • YA_FORCE_ANSI - Set to 1 to force ANSI color output

Exit Codes

  • 0 - Success
  • 1 - Error occurred (e.g., cannot connect to instance, invalid arguments)

Communication Protocol

ya communicates with Yazi instances using DDS (Data Distribution Service). The instance must be running with a valid client ID for communication to work.

Finding Instance IDs

When Yazi starts, it sets the YAZI_ID environment variable. You can use this in shell commands:
echo $YAZI_ID
For sending commands from outside a Yazi shell, you need to know the instance ID (specified via --client-id when starting Yazi).

See Also

  • yazi - Main Yazi command
  • emit - Command emission reference
  • pub-sub - Pub/sub messaging reference
  • package - Package management reference

Build docs developers (and LLMs) love