Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📦 pkgwrap

One command. Every package manager.

License PyPI Version Python Versions GitHub Stars GitHub Forks Last Commit Open Issues Code Size Supported Platforms PRs Welcome Maintained


Remembering the exact syntax to install a package across different operating systems (apt, pacman, brew, apk) is a frustrating and error-prone chore. pkgwrap solves this context-switching fatigue by giving you one universal command that automatically detects your OS and translates standard operations into native syntax.


Why pkgwrap?

  • Zero Configuration: Automatically detects your OS and native package manager out of the box—no setup required.
  • Muscle Memory Saver: Stop pausing to remember if it's pacman -S, apt install, or dnf install. Just type pkw install.
  • Smart Permissions: Automatically prefixes commands with sudo when required and prompts for confirmation, gracefully skipping if you're already running as root.
  • Ultra Lightweight: No heavy dependencies, network API calls, or bloated background services. It simply wraps your local package manager safely.

Why not just memorize apt/pkg/pacman? If you only ever use a single operating system, you probably should! But if you are a developer, sysadmin, or homelabber who frequently jumps between a Debian VPS, a macOS workstation, an Alpine Docker container, or a Termux shell on your phone, you know the pain of typing apt install on an Arch machine. pkgwrap eliminates that friction entirely

Architecture

pkgwrap operates on a clean, layered design. Input is processed at the CLI layer and passed to a detector that intelligently identifies the host system. The detector requests the appropriate backend from a registry, and the selected backend implementation handles the translation. Finally, the base class manages root privileges and user confirmation before executing the native process safely.

User runs `pkgwrap install nmap`
       |
       v
  [cli.py] -- argparse, flags (-y, --backend)
       |
       v
[detector.py] -- checks PREFIX/TERMUX_VERSION, platform.system(),
                 then shutil.which() in priority order
       |
       v
[backends/__init__.py registry] -- maps backend name to class
       |
       v
[Backend subclass] (apt/pkg/pacman/dnf/apk/brew/zypper/xbps/nix/
                    eopkg/freebsd)
       |
       v
[base.py _run_command()] -- sudo/root detection, confirmation,
                            subprocess.run(shell=False)
       |
       v
Native package manager executes

Supported Platforms

OS/Distro Backend Package Manager Command Status
Debian/Ubuntu apt apt ✅ Supported
Termux/Android pkg pkg ✅ Supported
Arch Linux pacman pacman ✅ Supported
Fedora dnf dnf ✅ Supported
Alpine apk apk ✅ Supported
macOS brew brew ✅ Supported
openSUSE zypper zypper ✅ Supported
Void Linux xbps xbps ✅ Supported
NixOS nix nix ✅ Supported
Solus eopkg eopkg ✅ Supported
FreeBSD pkg pkg ✅ Supported
  • Note: FreeBSD and Termux are automatically distinguished even though both can expose a pkg command, via strict OS/environment detection.

Installation

Via pip

pip install pkgwrap-lokesh

Via install script (no pip needed)

curl -fsSL https://raw.githubusercontent.com/trmxvibs/pkgwrap/main/install.sh | bash

From source (for contributors)

git clone https://github.com/trmxvibs/pkgwrap.git
cd pkgwrap
bash install.sh --source

Usage

pkgwrap install <package>
pkgwrap remove <package>
pkgwrap update
pkgwrap search <package>
pkw install <package>         # short alias, identical behavior
pkgwrap install <package> -y  # skip confirmation

Note: If you are already running as root (or use sudo directly), confirmation prompts are skipped automatically. Use the --backend flag to see which package manager pkgwrap has detected for your system.

Example

\$ pkgwrap install cowsay
ℹ The command 'sudo apt install -y cowsay' requires administrative privileges (sudo).
? Do you want to proceed with sudo? (y/N) y
→ Running: sudo apt install -y cowsay
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  cowsay
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
...
✔ Successfully finished installation process for 'cowsay'.

Contributing

Contributions, issues, and feature requests are always welcome! Adding support for a new package manager is as simple as creating a new file in the backends/ directory that implements the Backend interface. Feel free to open a ticket or submit a PR on our issues page.

Roadmap

  • Core universal wrapper (11 backends)
  • Automatic sudo/root detection
  • Termux-aware detection
  • Windows support (winget/choco)
  • Package name mapping across backends
  • Shell completion (bash/zsh)

License

MIT — see LICENSE file for details.


Made with ❤️ for the terminal by trmxvibs

About

One command. Every package manager. Universal CLI wrapper for apt, pkg, pacman, dnf, apk, brew, zypper, xbps, nix, eopkg & FreeBSD pkg.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages