Universal Package Manager - A wrapper for various system package managers
Project description
pkgx - Universal Package Manager
A cross-platform wrapper for various system package managers. pkgx automatically detects your system's package manager and provides a unified interface for common package management operations.
Supported Package Managers
- apt (Debian/Ubuntu)
- dnf (Fedora/RHEL 8+)
- yum (RHEL/CentOS/Fedora)
- microdnf (Minimal container environments)
- zypper (openSUSE)
- apk (Alpine Linux)
- brew (Homebrew - macOS/Linux)
- choco (Chocolatey - Windows)
Installation
Install with UV
# Install from current directory
uvx --from . pkgx --help
# Or install persistently
uv tool install .
Install from PyPI (once published)
# Install and run temporarily
uvx pkgx install git
# Install persistently
uv tool install pkgx
Usage
Basic Commands
# Install packages
pkgx install git vim curl
# Remove packages
pkgx remove old-package
# Update package lists
pkgx update
# Upgrade all packages
pkgx upgrade
# Upgrade specific packages
pkgx upgrade git vim
# Search for packages
pkgx search firefox
# List available package managers
pkgx list-managers
# Show version
pkgx version
Advanced Options
# Force a specific package manager
pkgx install git --manager apt
pkgx install git -m brew
# Dry run (show what would be executed)
pkgx install git --dry-run
pkgx upgrade --dry-run -n
How It Works
- Auto-detection: pkgx automatically detects available package managers on your system
- Priority Selection: Uses platform-specific preferences (e.g.,
apton Debian/Ubuntu,dnfon Fedora) - Unified Interface: Translates commands to the appropriate syntax for each package manager
- Cross-platform: Works on Linux, macOS, and Windows
Examples
Cross-platform Package Installation
# This command works on any supported system:
pkgx install git
# On Ubuntu/Debian, runs: apt install -y git
# On Fedora, runs: dnf install -y git
# On macOS with Homebrew, runs: brew install git
# On Windows with Chocolatey, runs: choco install git -y
Checking Available Managers
$ pkgx list-managers
Available package managers:
apt - apt ✓ available (auto-detected)
dnf - dnf ✗ not available
microdnf - microdnf ✗ not available
yum - yum ✗ not available
zypper - zypper ✗ not available
apk - apk ✗ not available
brew - brew ✓ available
chocolatey - choco ✗ not available
Auto-detected package manager: apt
Using Specific Managers
# Force use of a specific package manager
pkgx install nodejs --manager brew
pkgx search python --manager apt
Development
Project Structure
pkgx/
├── pyproject.toml # Package configuration
├── README.md # This file
└── pkgx/
├── __init__.py # Package metadata
├── cli.py # Main CLI interface
└── managers.py # Package manager implementations
Testing Locally
# Navigate to the pkgx directory
cd pkgx
# Test the tool without installing
uvx --from . pkgx list-managers
# Test specific commands with dry-run
uvx --from . pkgx install git --dry-run
Building and Publishing
# Build the package
uv build
# Publish to PyPI (requires configuration)
uv publish
Contributing
- Add support for new package managers by creating a new class in
managers.py - Extend the auto-detection logic in
detect_package_manager() - Update the documentation and examples
License
MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pkgx-0.1.1.tar.gz.
File metadata
- Download URL: pkgx-0.1.1.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02e77ec00d5c9ddc8888c8d0e5f840734687ba56964cdf91b95b7d73160cafb4
|
|
| MD5 |
51dbf07a9ef73ecd9de0ad66a463759c
|
|
| BLAKE2b-256 |
0797a314b468bef42f93037b84e2d228d48b6eec48e4c8151316dd699e9e91f3
|
File details
Details for the file pkgx-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pkgx-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d97cc499835cc24a89d0dd541d10c32041256cb59877cdfd7b1eb646c5a2d0be
|
|
| MD5 |
0705a802e03a1b9ff70ee807b5a550b5
|
|
| BLAKE2b-256 |
7fa677f81511c39db8a4d42fe3758a0e19a32e55aa5ebb460c04880582d33a42
|