Meet pkgx: A 4MB Binary That Lets You Run Any Tool Without Installing It
You know that moment when you need to run a quick jq command, or test a Python script, but you don't have the tool installed? Maybe you're on a fresh machine, a CI runner, or just want to avoid polluting your system with yet another package manager.
pkgx is a single, 4MB binary that solves this—by letting you run any tool directly, without ever installing it.
What It Does
pkgx (formerly known as "pkgx.sh") is a command-line tool that acts like a universal "run" command. You call it with the tool name and its arguments, and it downloads, caches, and runs the tool on the fly. No apt install, no brew install, no pip install. No global state. No root.
Think of it as npx for everything—except it works for languages, compilers, databases, and CLI tools across the board.
Why It’s Cool
A few things make pkgx stand out:
- Zero setup. You don't need to install Node, Python, Go, or any runtime beforehand. pkgx itself is a static binary, so you just download it once.
- 4MB footprint. That's the whole thing. No Docker, no VMs, no language runtimes. It's written in Rust, and it's fast.
- Smart caching. The first run downloads the tool. Subsequent runs use the cache. It doesn't clutter your home directory, and it cleans up old versions automatically.
- No package manager lock-in. It uses the same packages from Homebrew, but without Homebrew. It can also pull from URLs, tarballs, and GitHub releases directly.
- Works anywhere. Linux, macOS, CI, containers, and even on systems without
curlorwget(because pkgx includes its own minimal HTTP client).
A practical example: Want to run jq on a server where it's not installed? Just do:
pkgx jq '.foo' file.json
That's it. pkgx downloads jq if needed, runs it, and you're done.
How to Try It
Getting started is trivial. Open your terminal and run:
curl -fsSL https://pkgx.sh | sh
Or, if you're on macOS and have Homebrew:
brew install pkgx
Then try something:
pkgx python --version
pkgx go build .
pkgx pandoc README.md
You can also use it like a shebang in scripts:
#!/usr/bin/env pkgx
# using node and jq
exec pkgx node -e "$(pkgx jq -r '.foo' config.json)"
Check out the GitHub repo for full docs and more examples.
Final Thoughts
pkgx isn't trying to replace your package manager. It's for those "I just need this one tool for this one thing" moments. It's great for CI pipelines, ephemeral containers, teaching environments, or when you're hopping between machines and don't want to sync dotfiles.
It's simple, fast, and honest about what it does. If you've ever wasted 10 minutes installing a tool just to run a one-liner, pkgx is for you.
Follow us at @githubprojects for more tools like this.