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
Theemit and emit-to commands allow you to send commands to running Yazi instances. This enables automation, remote control, and integration with other tools.
emit
Emit a command to be executed by the current Yazi instance.Synopsis
Arguments
Name of the command to execute.This should be a valid Yazi command name (e.g.,
cd, refresh, search, select).Arguments to pass to the command.Arguments can include hyphens and are passed directly to the command handler.
Examples
Use Cases
Automation Scripts
Integration with Other Tools
Shell Functions
emit-to
Emit a command to be executed by a specific Yazi instance.Synopsis
Arguments
Receiver instance ID.This is the client ID of the target Yazi instance (specified via
--client-id when starting Yazi).Name of the command to execute.
Arguments to pass to the command.
Examples
Use Cases
Multi-Instance Orchestration
Remote Control
Build System Integration
Command Serialization
Commands are serialized as JSON arrays with the command name followed by arguments:- Unicode characters
- Spaces and special shell characters
- Binary data (converted to byte arrays)
Error Handling
Both commands will exit with status code1 and print an error message if:
- The target instance is not reachable
- The instance ID is invalid (for
emit-to) - The command fails to serialize
- DDS communication fails
Environment Variables
Current Yazi instance ID. Set automatically by Yazi.Used by
emit to determine the target instance.Alternative to
YAZI_ID. Contains the instance process ID.