Run Anything
Run anything:
Command not found? Command no problem.
The above requires shell integration (run: pkgx integrate --dry-run
).
Run Any Version
Generally you probably want @
syntax, but if you need more specificity we fully support SemVer:
Running the Latest Version
pkgx foo
runs the latest “foo” that is installed.
If you want to ensure the latest version of foo is installed, use pkgx foo@latest
.
Specify pkgx@latest
to ensure you have the latest pkgx
installed.
The newer pkgx is installed to ~/.pkgx
like every other pkg. If you need the installed pkgx
to be updated then brew upgrade
or re-run the installer.
Endpoints
Some packages provide typical usages via an endpoint
entry in their pantry entry and can be started via pkgx +brewkit -- run
.
These are often used to do the equivalent of a project’s getting started steps. For example pkgx +brewkit -- run llama.cpp
downloads the model and launches a chat interface and pkgx +brewkit -- run stable-diffusion-webui
launches the web-ui.
Adding Additional Packages to the Execution Environment
With our shellcode env +openssl
adds OpenSSL to the shell environment. When using pkgx
as a runner you can add additional packages to the execution environment with the same syntax:
Idiomatically, -node
can be used to exclude a package that may already exist in the environment.
'-*'
can be used to exclude everything. Note that you typically will need to quote the asterisk since shells will otherwise interpret it as an attempt to glob.
The first argument that doesn’t start with -
or +
is considered the first argument to the runner. All arguments that follow are passed to that program.
Disambiguation
In some cases pkgx foo
may be ambiguous because multiple packages provide foo
.
In such cases pkgx
will error and ask you be more specific by using fully-qualified-names :
In general it's a good idea to specify fully qualified names in scripts, etc. since you want these to work forever.
Running System Commands
It can be useful to run system commands with a package environment injected. To do this either specify the full path of the system executable:
Or use --
which is the standard POSIX way to tell tools like pkgx
to stop processing args:
If you only specified make
rather than /usr/bin/make
then pkgx
would install GNU make for you and use that.
Last updated