Skip to main content

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

Options

boolean
default:"false"
Print version information and exit.

Commands

emit

Emit a command to be executed by the current instance.
See emit command documentation for details.

emit-to

Emit a command to be executed by a specific instance.
See emit command documentation for details.

pkg

Manage packages (plugins and flavors).
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.
See pub-sub documentation for details.

pub-to

Publish a message to a specific instance.
See pub-sub documentation for details.

sub

Subscribe to messages from all remote instances.
See pub-sub documentation for details.

Examples

Quick Command Execution

Instance Communication

Package Management

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:
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