Repo of the Day
pkgxdev/pkgx
Published: Oct 15, 2023
Open repository ↗“run anything” from the creator of brew
Summary
pkgx is a single 4 MiB Rust binary that runs command-line tools on demand without installing them system-wide, keeping everything sandboxed under ~/.pkgx. It supports pinning exact versions (for example, pkgx node@14) and runs on macOS, Linux, Windows (experimental), Docker, and CI/CD runners.
What it is useful for
Engineers hit two recurring problems: a tool missing on a fresh machine, and version drift between local and CI. pkgx addresses both by letting you invoke any supported program by name and version, then discarding it on exit, so the wider system stays untouched. Concretely, you can run pkgx deno to use Deno 2.1.4 with no installer, or pkgx python@2 --version to compare against Python 2.7.18 next to a modern interpreter.
It is also useful for:
- One-off scripts that declare their runtime inline, e.g.
#!/usr/bin/env -S pkgx +git [email protected]. - CI pipelines that need specific tool versions without baking them into a container.
- Dockerfiles built on minimal base images that still need Python, Deno, or similar tools.
- Recursing into other ecosystems — you can chain into
uvx,bunx, ornpxfrom apkgxinvocation.
The README lists some limitations: Windows support is experimental with limited packages; Linux requires glibc ≥ 2.28 plus libgcc and libatomic, which some distros ship as a separate package or as part of the full gcc; and the catalog lives on the web at pkgx.dev/pkgs.
How engineers can use it
Install on macOS or Linux:
brew install pkgx || curl https://pkgx.sh | sh
On Windows 10+ (PowerShell, limited package coverage per the README):
irm https://pkgx.sh | iex
Basic invocations:
pkgx deno # run a tool by name
pkgx node@14 --version # pin to a specific version
pkgx -Q git # is a package available?
pkgx -Q # list everything runnable
For CI, the README documents a GitHub Actions step:
- uses: pkgxdev/setup@v4
- run: pkgx shellcheck
For containers, the project ships pkgxdev/pkgx on Docker Hub, so you can run docker run pkgxdev/pkgx [email protected] --version, or in a Dockerfile: FROM pkgxdev/pkgx followed by RUN pkgx [email protected] task start. Users coming from pkgx^1 are pointed at pkgx pkgx^1 deintegrate, pkgx dev integrate, and pkgm shim for /usr/local/-style installs. Full reference is in the README and at docs.pkgx.sh.