pkgx: Run Anything, Any Version, Anywhere with Ease

Summary
pkgx is a lightweight, standalone binary that empowers developers to run any command or tool without traditional installation, keeping their system clean and unpolluted. It provides effortless execution of specific software versions across macOS, Linux, and Windows, making it an ideal solution for managing project dependencies and accessing a vast ecosystem of tools.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
pkgx is a powerful, 4 MiB standalone binary built in Rust that allows you to run virtually any command or tool without needing to install it globally on your system. Its core philosophy is to provide tools that "just work," enabling developers to focus on building rather than worrying about dependency management and system pollution.
With pkgx, you can:
- Run Anything: Execute commands like
denoeven if they're not installed. - Run Any Version: Easily specify and run different versions of tools, such as
node@14orpython@2. - Run Anywhere: It supports macOS, Linux, Windows, Docker, and integrates seamlessly into CI/CD pipelines and scripts.
This approach ensures your wider system remains untouched, as tools are downloaded to ~/.pkgx rather than being globally installed.
Installation
Getting started with pkgx is straightforward. Choose the method that suits your operating system:
macOS / Linux:
brew install pkgx || curl https://pkgx.sh | sh
Windows 10+:
irm https://pkgx.sh | iex
For more detailed installation options, including installing without Homebrew, refer to the official documentation.
Examples
Experience the simplicity of pkgx with these quick examples:
Running a command not installed on your system:
$ deno
command not found: deno
$ pkgx deno
Deno 2.1.4
> ^D
$ deno
command not found: deno
# ^^ nothing was installed; your wider system is untouched
Running specific versions of tools:
$ pkgx node@14 --version
Node.js v14.21.3
$ pkgx python@2 --version
Python 2.7.18
Why Use pkgx
pkgx offers significant advantages for developers and teams:
- Clean System: Tools are run on demand and cached locally, but never globally installed, preventing system clutter and conflicts.
- Effortless Version Management: Switch between tool versions instantly without complex environment setups.
- Cross-Platform Compatibility: Consistent behavior across macOS, Linux, and Windows, including WSL2 and Docker environments.
- CI/CD Integration: Easily incorporate specific tool versions into your continuous integration and deployment workflows.
- Powerful Scripting: Enhance your shell scripts by declaring dependencies directly in the shebang, ensuring all necessary tools are available.
- Ecosystem Tools: pkgx is part of a broader ecosystem including:
- Recursive Run: Easily execute tools from other language ecosystems, such as Python (via
uvx) or JavaScript (viabunx), directly through pkgx.
Links
- GitHub Repository: pkgxdev/pkgx
- Official Documentation: docs.pkgx.sh
- Package Listing: pkgx.dev/pkgs
- Discord Community: Join the Discord