#1204·pkgx

Ultra Portable Scripts for fish

Author: davdromanCreated Sep 16, 2025Updated Oct 15, 2025

I really like this part of pkgx: https://docs.pkgx.sh/pkgx/scripting#ultra-portable-scripts

And while I do prefer writing bash for scripts, I use fish as my terminal shell.

So I'd like to be able to do the following when implementing my fish aliases/functions:

fish
function xc
    eval "$(pkgx +aria2c@latest +xcodes@latest)" # whatever the equivalent of this is in fish

    if test (count $argv) -ge 2; and test $argv[1] = runtimes; and test $argv[2] = install
        sudo xcodes $argv
    else
        xcodes $argv
    end
end

Effectively, I want to be able to declare all my local function dependencies at the very top and not have to worry about how to invoke them throughout my implemention.

Is this feasable?