pkgz v0.1.4

A fast, extensible CLI package manager in Crystal πŸ’Ž. Unified install across Apt, Flatpak, Pacstall, Pacman, Paru and more!

Pkgz Logo

Pkgz is a fast, extensible CLI tool written in Crystal πŸ’Ž for managing software packages across multiple Linux distributions.


✨ Features

  • βœ… Install, remove, update and search apps
  • πŸ” Interactive source selection if app is available in multiple sources
  • πŸ” Automatically uses doas or sudo for privilege elevation
  • πŸ“¦ Supports:
    • Apt / Nala (Debian/Ubuntu)
    • Flatpak
    • Pacman (Arch)
    • Paru (AUR helper)
    • DNF (Fedora/RHEL)
    • Pacstall
    • FreeBSD & FreeBSD Ports
    • OpenBSD & OpenBSD Ports
  • βš™οΈ Configurable via ~/.config/pkgz/config.toml
  • 🌱 Extensible to support other package managers

πŸ“¦ Requirements

To use pkgz, you’ll need the following:

  • Privilege elevation:
    Either sudo or doas must be installed

  • At least one supported package manager:
    apt, nala, pacman, paru, dnf, or pacstall

  • Crystal compiler:
    Only needed if you're building from source
    (Prebuilt binaries don’t require Crystal)


βš™οΈ Configuration

Create or edit ~/.config/pkgz/config.toml:

[sources]
apt = true
nala = false
flatpak = true
paru = false
pacman = false
dnf = false
pacstall = true
freebsd = false
freebsd_ports = false
openbsd = false
openbsd_ports = false

[elevator]
command = "sudo"  # or "doas"

This controls enabled sources and privilege elevator. If missing, Pkgz will prompt and exit.


πŸ›  Installation

πŸ§ͺ Recommended: One-liner Install (Linux x86_64)

You can install the latest prebuilt binary directly with:

curl -sS https://raw.githubusercontent.com/roguehashrate/pkgz/main/install.sh | bash

This installs pkgz to ~/.local/bin.
Make sure ~/.local/bin is in your $PATH.


πŸ” Verify Download (Optional)

To verify the integrity of the binary:

curl -LO https://github.com/roguehashrate/pkgz/releases/download/v0.1.4/pkgz
curl -LO https://github.com/roguehashrate/pkgz/releases/download/v0.1.4/pkgz.sha256

sha256sum -c pkgz.sha256

Build from Source

git clone https://github.com/roguehashrate/pkgz
cd pkgz
crystal build src/pkgz.cr --release -o pkgz
sudo mv pkgz /usr/local/bin/

Debian .deb Package

wget https://github.com/roguehashrate/pkgz/releases/download/v0.1.4/pkgz-0.1.4.deb
sudo dpkg -i pkgz-0.1.4.deb
sudo apt-get install -f  # Fix dependencies if needed

Prebuilt Binary

Download from Releases:

sudo mv pkgz /usr/local/bin/
sudo chmod +x /usr/local/bin/pkgz

Tarball (for Arch and others)

wget https://github.com/roguehashrate/pkgz/releases/download/v0.1.4/pkgz-0.1.4-x86_64.tar.gz
tar -xvf pkgz-0.1.4-x86_64.tar.xz
sudo cp pkgz-0.1.4/usr/bin/pkgz /usr/bin/

Or install locally:

mkdir -p ~/.local/bin
cp pkgz-0.1.4/usr/bin/pkgz ~/.local/bin/

Make sure ~/.local/bin is in your PATH.


πŸ“¦ Pacstall Support & Local Installation

pkgz supports installing packages via Pacstall, a universal package manager for Linux.

  1. Ensure Pacstall is installed on your system. For installation instructions, visit https://pacstall.dev/

  2. Install the local .pacstall package file using:

pacstall -I /path/to/pkgz.pacstall

This will install pkgz without needing to publish the package remotely.

Afterward, you can use pkgz as usual to manage software packages across supported sources.

The pacstall file will likely always be ahead of the pacstall repos.


πŸš€ Usage

pkgz <install|remove|update|search|--version> [app-name]

Examples:

pkgz install gimp
pkgz remove neofetch
pkgz update
pkgz --version

Sample output:

$ pkgz install gimp
πŸ” Searching for 'gimp' in sources...
πŸ“¦ Found 'gimp' in multiple sources:
1. APT
2. Flatpak
Which one would you like to use? [1-2]: 2
πŸš€ Installing with Flatpak...

πŸ” Privilege Elevation

  • Automatically detects and uses doas or sudo.
  • Privileged commands are run with the configured elevator command.

🧩 Extending Pkgz

To add support for a new package manager:

  1. Subclass Pkgz::Source
  2. Implement:
    • name
    • available?(app)
    • install(app)
    • remove(app)
    • update
  3. Add your source to the enabled sources list and config.

πŸͺͺ License

MIT License

Created by roguehashrate

Repository

pkgz

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 1
  • 4 days ago
  • June 23, 2025
License

MIT License

Links
Synced at

Sat, 05 Jul 2025 05:25:06 GMT

Languages