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.
Global Variables
cx
The context object containing the current application state. See Context API for details.
plugin
The current plugin’s module table (available in plugin context).
Global Functions
Err(format, ...)
Create a custom error with formatted message.
Format string (printf-style)
Format arguments
Custom error object
Helper Functions (from ya.lua)
These utility functions are available globally via theya namespace:
ya.clamp(min, x, max)
Clamp a value between minimum and maximum.
Minimum value
Value to clamp
Maximum value
Clamped value
ya.list_merge(a, b)
Merge list b into list a (modifies a).
Target list
Source list
The modified list
aya.dict_merge(a, b)
Merge dictionary b into dictionary a (modifies a).
Target dictionary
Source dictionary
The modified dictionary
aya.readable_size(size)
Format byte size as human-readable string.
Size in bytes
Formatted size (e.g., “1.5M”, “3.2G”)
ya.readable_path(path)
Format path with ~ for home directory.
Absolute path
Path with
~ prefix if under home directoryya.child_at(pos, children)
Find the child element at the given position.
Position
{x, y} or Pos objectList of child elements with
_area fieldThe child element at the position, or nil
Environment Variables
Access environment variables using Lua’sos.getenv():