FAQ
How do I run the latest version of pkgx
?
pkgx
?Typically you want to upgrade pkgx
so either:
brew upgrade pkgx
; orcurl -LSsf pkgx.sh | sh
[!NOTE] Indeed! Our installer installs and upgrades too.
OTOH, pkgx
packages itself so:
Is a valid command, provided you have shell integration.
How do I run the latest version of a specific pkg?
Unless otherwise instructed, pkgx
executes the latest version of pkgs that are cached. The first time you run a pkg the latest version will be cached, but after that updates will only be fetched if requested.
For us neophiliacs we have written a [mash
] script to check for newer versions of what you have cached and fetch them:
OSS.app can automatically install updates.
How do I “install” pkgs?
To make pkgs available to the wider system use pkgx install
.
You can update installed packages with pkgx install foo@latest
What is a package?
A package is:
A plain tarball containing a single project for a single platform and architecture compiled from that project’s sources
A bundle of metadata (
package.yml
) from the [pantry]
Relative to some other packaging systems:
No scripts are executed post install
Packages must work as is from any location provided their deps are installed in parallel (we say our pkgs are “relocatable“)
A package version I need is unavailable
Sorry about that. Open a ticket asking for it and we’ll build it.
I need to pin a pkg to greater than v20.1.3 but less than v21
The commonly used @
syntax would pin the pkg to v20.1.x (@20.1.3
).
To provide more control we support the full semantic version range syntax. So for the given example we would use the caret (^
):
Which will match node v20.1.3 up to but not including v21.
What does +pkg
syntax do?
+pkg
syntax do?+pkg
syntax is a way to include additional pkgs in your environment. Typing pkgx +deno
dumps the environment to the terminal, if you add additional commands then those commands are invoked in that environment.
How do I list what packages are cached?
We have created a [mash
] script to list cached packages:
All packages are encapsulated in individual, versioned folders in ~/.pkgx
just like brew
so you can just browse them with a file browser.
A pkg I was expecting is not available
Open source is ever moving and somebody needs to keep up with it. You may need to contribute to the pantry.
Where do you put pkgs?
Everything goes in ~/.pkgx
. eg. Deno v1.2.3 installs an independent POSIX prefix to ~/.pkgx/deno.land/v1.2.3
, thus the deno
executable is at ~/.pkgx/deno.land/v1.2.3/bin/deno
.
We also install symlinks for majors, minors and latest:
Open source is vast and unregulated, thus we use fully-qualified naming scheme to ensure pkgs can be disambiguated.
Can I bundle ~/.pkgx
into my distributable app?
~/.pkgx
into my distributable app?Yes! Our pkgs are relocatable.
Will you support other platforms?
We would love to support all platforms. All that is holding is back from new platforms is expertise. Will you help? Let’s talk.
How do I add my package to pkgx?
You need to add to the pantry.
Eventually we will support describing how to build or obtain distributables for your package via your repo so you can just add a pkgx.yaml
and users can use pkgx to use your package automatically.
How should I recommend people install my pkg with pkgx?
You can also recommend our shell one-liner if you like:
Will for example install pkgx and your pkg then open a new shell with it available to the environment.
What happened to ”Magic”?
We removed “magic” from pkgx at v1 because it had a number of unsolvable issues. If you want it back however fortunately the shellcode is simple:
I added a package to the pantry but pkgx foo
fails
pkgx foo
failsTry pkgx --sync foo
to force a pantry sync. Typically this isn’t needed but this flag can help in confusing situations.
How do I uninstall pkgx
?
pkgx
?We’ll provide pkgx uninstall pkgx
at some point, for now:
Then there are a couple platform specific cache/data directories:
macOS
Non macOS
What are the rules for @
syntax?
@
syntax?The rules for @
are complex, but more human. We convert them to the following semver syntax:
@3
→^3
@3.1
→~3.1
@3.1.2
→>=3.1.2<3.1.3
@3.1.2.3
→>=3.1.2.3<3.1.3.4
etc.
Where does pkgx
store files
pkgx
store filespkgs are cached to
~/.pkgx
($PKGX_DIR
overrides)pkg tarballs are cached to
~/Library/Caches/pkgx
on Mac~/.cache/pkgx
on *nix%LOCALAPPDATA%/cache/pkgx
on Windows⚠️⚠️
$XDG_CACHE_HOME
overrides on all platforms
runtime data like the [pantry] is stored in:
~/Library/Application Support/pkgx
on Mac~/.local/share/pkgx
on *nix%LOCALAPPDATA%/pkgx
on Windows⚠️⚠️
$XDG_DATA_HOME
overrides on all platforms
If
$XDG_STATE_HOME
is set then$XDG_STATE_HOME/pkgx
is used for some temporary shellcode state.
What happens if two packages provide the same named program?
We error with a method to disambiguation, eg:
How do I see a man page for a pkgx pkg?
man foo
won’t work since pkgx pkgs are not “installed”. Thus you have to first create an environment that contains that package before invoking man
:
This uses pkgx’s man
tool. To use the system man
:
I have another question
Last updated