pkgz v0.2.0
Pkgz is a fast, extensible CLI tool written in Go 🐹 for managing multiple package types on Linux and BSD distributions.
✨ Features
- ✅ Install, remove, update and search apps
- 🔍 Interactive source selection if app is available in multiple sources
- 🔐 Automatically uses
doasorsudofor privilege elevation - 📦 Supports:
- Apt / Nala (Debian/Ubuntu)
- Flatpak
- Pacman (Arch)
- Paru (AUR helper)
- Yay (AUR helper)
- DNF (Fedora/RHEL)
- APK (Alpine)
- Pacstall
- Zypper (openSUSE)
- XBPS (Void)
- Nix (
Untested) - FreeBSD & FreeBSD Ports (
Untested) - OpenBSD & OpenBSD Ports (
Untested)
- ⚙️ Configurable via
~/.config/pkgz/config.toml - 🌱 Extensible to support other package managers
📦 Requirements
To use pkgz, you’ll need the following:
-
Privilege elevation:
Eithersudoordoasmust be installed. -
At least one supported package manager:
Linux:apt,nala,flatpak,pacman,paru,yay,dnf,zypper,apk,xbps,nixorpacstall
BSD:FreeBSD pkg,FreeBSD Ports,OpenBSD pkg,OpenBSD Ports -
Go compiler:
Only needed if you're building from source.
Required for building from source.
⚙️ Configuration
Create or edit ~/.config/pkgz/config.toml:
# Enable/disable package manager sources
[sources]
apt = false
nala = false
flatpak = false
paru = false
yay = false
pacman = false
dnf = false
pacstall = false
zypper = false
xbps = false
nix = false
freebsd = false
freebsd_ports = false
openbsd = false
openbsd_ports = false
# Privilege escalation method (required)
[elevator]
command = "sudo" # or "doas"
Configuration Notes:
- Only enable sources you actually use by setting them to
true - You must have an elevator configured (
sudoordoas) - The config file must be created manually before first run
- The program will show a template if the config file is missing
🛠 Installation
🔨 Build from Source
Prerequisites:
- Go compiler (required for building from source)
- git (for cloning the repository)
🔨 Interactive Build (Recommended)
Purpose: Build for your specific target platform interactively
git clone https://github.com/roguehashrate/pkgz
cd pkgz
chmod +x build.sh
./build.sh
The script will ask you to select:
- Operating system (linux, darwin, freebsd, openbsd)
- Architecture (amd64, 386, arm64, arm)
Output: Creates a compressed binary in build/{OS}/{ARCH}/
- Binary:
build/{OS}/{ARCH}/pkgz.gz(extracts to 'pkgz')
📦 Install the Binary
After building completes, install the binary to make it available system-wide:
If you have a compressed binary (.gz):
cp build/{OS}/{ARCH}/pkgz.gz ~/.local/bin/
cd ~/.local/bin
gunzip pkgz.gz
chmod +x pkgz
Verify installation:
pkgz --version
Note: Make sure ~/.local/bin is in your PATH. If not, add:
echo 'export PATH="$PATH:~/.local/bin"' >> ~/.bashrc
source ~/.bashrc
or if you are a zsh user
echo 'export PATH="$PATH:~/.local/bin"' >> ~/.zshrc
source ~/.zshrc
🚀 Usage
Examples:
pkgz install gimp
pkgz remove gimp
pkgz clean
pkgz info # Show package counts per source
pkgz info gimp # Show specific package status
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
doasorsudo. - Privileged commands are run with the configured elevator command.
🧩 Extending Pkgz
To add support for a new package manager:
- Implement the
Sourceinterface - Implement the interface methods:
Name()Available(app string)Install(app string)Remove(app string)Update()Search(app string)
- Add your source to the enabled sources list and config.
🔄 Migration from Crystal
This project was originally written in Crystal and has moved to Go mostly for compatablity reasons and also because a user is more likely to have Go installed on their system than Crystal so it reduces friction a little.
📄 License
This project is licensed under the BSD 2-Clause License.
See the LICENSE file for the full license text.
Created by roguehashrate
pkgz
- 3
- 0
- 0
- 0
- 1
- 1 day ago
- June 23, 2025
BSD 2-Clause "Simplified" License
Thu, 15 Jan 2026 08:46:07 GMT