Repository navigation
pkgwrap v0.2.0
One command. Every package manager — now across 17 backends, with safer defaults and a source-only install.
Breaking: pkgwrap is no longer published on PyPI. The
pkgwrap-lokeshpackage is unmaintained. Install from source withinstall.sh(see below).
⚠️ Safety fixes (please read if you used 0.1.x)
Non-interactive flags are no longer forced. Previously -y / --noconfirm were hardcoded into every install and remove command, which silenced the package manager's own confirmation. Combined with automatic root detection, a destructive command could run with no prompt at all. These flags are now added only when you pass -y.
Package managers that never prompt on their own (apk, brew, nix, MacPorts, winget, pkg_add) now get an explicit pkgwrap confirmation before removals, so you are never left without a safety net.
Package names are validated before they reach the package manager: anything that looks like a command-line flag, or contains characters outside a conservative allow-list, is rejected.
The detection cache is validated against the backend registry, so a corrupted or hand-edited cache file can no longer steer which package manager runs.
✨ New
- Multiple packages per command —
pkgwrap install curl wget nmap --dry-run/-n— print the exact command without executing it- Separate
refreshandupgrade—refreshonly updates repository metadata;upgradeupgrades packages.updateno longer performs a full system upgrade by surprise. - New commands:
list,info,clean --backend NAMEforces a backend;PKGWRAP_BACKENDdoes the same globally--no-cacheand--clear-cache- 5 new backends:
yum,emerge(Gentoo),port(MacPorts),openbsd(pkg_add, also NetBSD),choco(Windows fallback) — bringing the total to 17 - Explicit macOS and Windows detection with actionable messages when no package manager is present
XDG_CONFIG_HOMEis respected for the cache location
🐛 Fixed
- Windows crash: Unicode status symbols raised
UnicodeEncodeErroron legacy code pages (cp1252/cp437). Symbols now fall back to ASCII automatically. - Exit codes: a process killed by a signal reported a meaningless status (
-9surfaced as 247); it now reports128 + N. pkgwrap --backend install nmapused to print the backend and silently skip the install. The ambiguous form is now rejected with a clear message.- ANSI colour is no longer emitted when output is piped or redirected.
NO_COLOR,PKGWRAP_NO_COLOR,FORCE_COLORandTERM=dumbare honoured. print_warninggenuinely exists now, instead of silently falling back toprint_info.- Confirmation prompts no longer hang when stdin is not a terminal.
📦 Installation changed
install.sh is now a source installer. It clones (or updates) the repository and installs from the checkout, handling PEP 668 externally-managed environments properly: pipx → pip --user → a dedicated venv with pkgwrap/pkw shims in ~/.local/bin.
curl -fsSL https://raw.githubusercontent.com/trmxvibs/pkgwrap/main/install.sh -o install.sh
less install.sh # always read a script before running it
bash install.shNew flags: --local, --update, --uninstall.
Upgrading from the PyPI package:
pip uninstall pkgwrap-lokesh # or: pipx uninstall pkgwrap-lokesh
bash install.sh🏗️ Project health
- GitHub Actions CI: pytest across Python 3.9–3.13 on Linux, macOS and Windows, plus ruff, shellcheck and a clean-clone install check
- Test suite grown from 32 to 315 tests, including full coverage of the privilege-escalation and confirmation logic, and contract tests every backend must satisfy
CONTRIBUTING.md,SECURITY.md,CODE_OF_CONDUCT.md, issue and PR templatespy.typedmarker and complete project metadata
🙏 Contributors
Thanks to @kaminimangal for the winget backend (#9) and package name mapping (#10), both of which are included here in extended form.
🧪 Help wanted
Five backends — yum, emerge, port, openbsd and choco — were written from documentation and have not yet been verified on real systems. If you run one of these, please try pkgwrap <command> --dry-run and open an issue with what you see. Contributions welcome.
Full changelog: CHANGELOG.md