Skip to main content

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

  1. Auto-detection: pkgx automatically detects available package managers on your system
  2. Priority Selection: Uses platform-specific preferences (e.g., apt on Debian/Ubuntu, dnf on Fedora)
  3. Unified Interface: Translates commands to the appropriate syntax for each package manager
  4. 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

  1. Add support for new package managers by creating a new class in managers.py
  2. Extend the auto-detection logic in detect_package_manager()
  3. Update the documentation and examples

License

MIT License - see the LICENSE file for details.

Metadata

Release files for pkgx 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pkgx 0.1.1
File Size Uploaded
pkgx-0.1.1.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pkgx 0.1.1
File Interpreter ABI Platform
pkgx-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.1 kB

Release files / pkgx-0.1.1.tar.gz

Download URL pkgx-0.1.1.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
02e77ec00d5c9ddc8888c8d0e5f840734687ba56964cdf91b95b7d73160cafb4
BLAKE2b-256 checksum
How to use checksums
0797a314b468bef42f93037b84e2d228d48b6eec48e4c8151316dd699e9e91f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Release files / pkgx-0.1.1-py3-none-any.whl

Download URL pkgx-0.1.1-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d97cc499835cc24a89d0dd541d10c32041256cb59877cdfd7b1eb646c5a2d0be
BLAKE2b-256 checksum
How to use checksums
7fa677f81511c39db8a4d42fe3758a0e19a32e55aa5ebb460c04880582d33a42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page