Skip to main content

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

  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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pkgx-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pkgx-0.1.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

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

Hashes for pkgx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 02e77ec00d5c9ddc8888c8d0e5f840734687ba56964cdf91b95b7d73160cafb4
MD5 51dbf07a9ef73ecd9de0ad66a463759c
BLAKE2b-256 0797a314b468bef42f93037b84e2d228d48b6eec48e4c8151316dd699e9e91f3

See more details on using hashes here.

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

Hashes for pkgx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d97cc499835cc24a89d0dd541d10c32041256cb59877cdfd7b1eb646c5a2d0be
MD5 0705a802e03a1b9ff70ee807b5a550b5
BLAKE2b-256 7fa677f81511c39db8a4d42fe3758a0e19a32e55aa5ebb460c04880582d33a42

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page