Comment on page
$ pkgx install node
Installations are just stubs that precisely specify what version of tools you want:
$ cat ~/.local/bin/node
exec pkgx +nodejs.org=20.5.1 node "$@"
Indeed, we only install one file to the system environment. Packages cache to
~/.pkgx, if you were to delete
~/.pkgxthe installed shim would still work.
pkgx installoperates via a
pkgxshim, only the tools you install become available to the system environment. Open source is complex and tools can have hundreds of dependencies. With
pkgxyou don’t pollute your system with these unwanted tools (thus avoiding a myriad of unexpected consequences).
All your tools have minimal surface area.
If you invoke
sudowe install to
It would be insecure to store the package caches in userland (
~/.pkgx) and tools would not work for multiple users anyway; so if you install with root we also cache the packages (root-owned ofc) in
As a convenience
pkgx install(unadorned) installs the active environment.
$ env +node
(+node) $ pkgx install
$ env -node
error: node is installed # installed items are removed from the environment
$ env +node
error: node is installed
$ env +node@20
error: node@20 is installed
$ env +node@18
# ^^ this is ok since you didn’t install this version
(+node@18) $ node --version
pkgx install ruff@latest
pkgx install node@16
[sudo] pkgx uninstall node
sudoinstalled you will need to
Last modified 20d ago