The README includes are you looking for: https://github.com/sxyazi/yazi#usage
# Rename this file to match the name of the function
# e.g. ~/.config/fish/functions/ya.fish
# or, add the lines to the 'config.fish' file.
function ya
set tmp (mktemp -t "yazi-cwd.XXXXX")
yazi --cwd-file="$tmp"
if set cwd (cat -- "$tmp") && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]
cd -- "$cwd"
end
rm -f -- "$tmp"
end