haj
the beautiful, cross-distro package manager and tui. (and yes, it is named after the ikea shark. all hail blahaj. 🦈)
haj is a modern, memory-safe wrapper for pacman written in rust. It replaces arch's notoriously loud and verbose terminal output with the clean, minimalistic aesthetic of modern package managers like cargo and bun, without compromising on speed or safety. also comes with love from the supreme plushie shark.
currently works on virtually every pacman-based distro: arch, blahArch, artix, endeavourOS, garuda, manjaro, cachyOS, and 25+ more.
support for apt is being worked upon.
features
the tui dashboard
haj now features a ridiculously-fast, interactive tui powered by ratatui. run haj tui to access:
-
the ultimate package browser: a beautiful, responsive explorer. search live, cycle filters with
tab(aur, installed, updates, repos), and press1-4to seamlessly lazy-load rich package overviews, dependency trees, and installed file paths without ever freezing the ui. -
smart batch queueing: press
spaceto toggle packages and build a virtual install/remove queue, keeping memory usage minimal even with 100,000+ aur packages loaded. -
transaction history & groups: press
hto browse your parsed package transaction history (what upgraded, what failed, and when), orgto quickly explore and install arch package groups. -
the orphan sweeper & cache manager: hit
oon the dashboard to instantly detect and vaporize unneeded dependencies, orcto clean your package cache natively. -
live commands popups: haj streams native pacman execution logs directly into floating, minimalist ui panels with live transaction logs, concise progress indicators, and native pacman output without the wall of noise.
-
system statistics: press
tfor a cozy dashboard tracking your explicit packages, dependency splits, disk usage, and system health at a glance. -
3d rotating blahaj (best): a fully 3D, spinning ascii art shark rendered natively via display3d.
cli highlights
- native package browser: browse repositories, inspect dependencies, installed files, package metadata and groups entirely inside the tui with asynchronous lazy loading.
- interactive search-install: type a naked query (e.g.,
haj discord) to display a numbered table of matching native and AUR packages. Select numbers (e.g.,1 3) to queue them instantly. - aur PKGBUILD auditing: press
vduring the aur pre-transaction prompt to inspect the livePKGBUILDvia a fast shallow clone, opens right inside your default text editor like neovim. - arch news safety guard: before running
haj jump, the system pings the official Arch rss feed. If a post from the last 7 days requires manual intervention,hajdisplays an unmissable red warning banner with the headline. - system overview (
stats): a clean status dashboard tracking package counts, explicit vs. dependency splits, cache sizes, update counts, and system health at a glance. - the cargo/bun aesthetic: no more jagged progress bars or walls of text.
hajparsespacmanoutput streams in real-time, displaying a single, elegant progress spinner and clean transaction summaries. - native libalpm backend:
hajusesalpm.rs(C bindings forlibalpm) to query your local and sync databases directly in memory.
how it works
haj is completely transparent and relies entirely on standard arch linux infrastructure:
- reads (
search,show,orphan) are done natively vialibalpmbindings for maximum performance. - writes (
install,remove,update,clean) are handed off securely to standardpacmansubprocesses (pacman -S,pacman -Rs, etc.).hajintercepts thestdout/stderrstreams via pseudo-terminals (pty), filters out the verbose noise, applies color formatting, and pipes the cleaned data to your screen in real-time.
installation
aur
you can install haj using your favorite aur helper:
# or
nix
install or run haj directly with nix flakes (builds with pure-cli fallback by default to avoid libalpm version skew):
# run once without installing
# install into your nix profile
# optional: opt into libalpm bindings
or add it to a flake config:
inputs.haj.url = "github:asitos/haj";
# add inputs.haj.packages.${pkgs.stdenv.hostPlatform.system}.default to packages
cargo
requires rust + cargo to be installed:
from source
requires the rust toolchain (cargo).
the install script builds haj in release mode, auto-detects libalpm (falling back to --no-default-features when unavailable), and installs the binary + shell completions to /usr/local.
useful flags:
# also install optional 3d rotating shark renderer
# build without libalpm bindings
# install to custom prefix (e.g. ~/.local without sudo)
# uninstall haj binary and completions
pacman (blaharch-repo)
install haj from the official blahArch repo for future updates through pacman,
add this to the bottom of your /etc/pacman.conf:
then just sync and install normally (or update haj if it is already installed):
source release bundle
every source release includes the exact display3d source required by haj under third_party/display3d. build and install both binaries:
docker
you can run haj inside an arch linux container to safely test package operations without affecting your host system.
to build the image:
to run haj:
warning: haj inside docker manages the container's arch environment, not your host. do not bind-mount the host /, /etc, /var/lib/pacman, or the host pacman database into it. doing so will risk corrupting your host package database.
package operations performed here affect only the container. if you want to persist the container's package database and cache across runs, use named docker volumes:
usage & commands
haj uses natural, typing-friendly verb-action syntax and short aliases across both the cli and the interactive tui.
commands & options
| command | aliases | action |
|---|---|---|
tui |
t |
launch the interactive package manager dashboard |
update |
up, sync, refresh |
synchronize remote repositories |
upgrade [pkg] |
jump |
upgrade system or specific packages (--no-sync) |
install <pkg|file> |
add, i, a |
install packages or local archive (--from aur|repo) |
remove <pkg> |
rm, toss, uninstall, delete, drop |
remove packages & unneeded dependencies |
search <query> |
s, find |
search official repositories & aur |
show <pkg> |
info, about, describe |
show detailed package information |
group <name> |
g |
browse and install package groups / meta-packages |
list [filter] |
ls |
list installed packages (explicit, deps, aur, foreign, orphans, updates) |
stats |
st |
show system health and package statistics |
load <file> |
l |
install a local package archive (.pkg.tar.zst) |
fetch <pkg> |
f, download, get |
download packages without installing |
downgrade <pkg> [to <ver>] |
sink, rollback |
downgrade an installed package |
owns <file> |
ow, owner, which |
find which installed package owns a file (who owns <path>) |
files [in|of] <pkg> |
lf |
list files installed by a package (list files <pkg>) |
locate <query> |
loc, where, find-file |
search repositories for a file (pacman -F) |
history |
h |
show recent package changes (-l <n>) |
orphan |
o, orphans, autoremove, prune |
detect or remove orphaned dependencies |
clean [cache|orphans] |
c |
clean package cache (-k <n>) or orphans |
mark <pkg> [as explicit|dep] |
m |
set or toggle a package's install reason |
diff |
pn, pacnew, merge |
interactively manage and merge .pacnew config files |
pkgbuild <pkg> |
pb |
read the PKGBUILD of an aur package |
-a,--aur: restrict operations to the aur.-r,--repo: restrict operations to arch repositories.--from <source>: restrict operations toaurorrepo.-y,--noconfirm: bypass all confirmation prompts.-n,--needed: do not reinstall up-to-date packages.-i,--ignore <pkg>: ignore a package upgrade (comma-separated: pkg1,pkg2).-c,--config <path>: specify an alternate pacman config file.--root <path>: specify an alternate installation root.--no-sync: do not sync package databases before upgrading (upgrade).-v,--verbose: enable verbose debug logging.-d,--dry-run: preview a command without modifying the system.-h,--help: display help information.-V,--version: show version info.
examples
launch the interactive dashboard:
# or
search and install with natural syntax or short aliases:
# interactive search and install
# search repos or aur
# install from repos or aur
upgrade, inspect, and clean up naturally:
# sync and upgrade
# inspect packages, files, and ownership
# manage marks, downgrades, cache, and orphans
safely preview removing a package:
shell autocompletion
haj supports shell autocompletion for bash, zsh, and fish, available in the releases tab assets after v0.2.8 onwards.
cd ~/.config/haj
curl -sSL https://github.com/asitos/haj/releases/latest/download/completions.tar.gz | tar -xz
1. fish setup
# system-wide (all-users)
# user-only
# restart shell or run the following command
2. bash setup
# system-wide (all-users)
# user-only
3. zsh setup
# user-only
# ensure ~/.zshrc includes completion path
fpath=(/.zsh/completion )
&&
# reload zsh
configuration
haj works perfectly out of the box, but can be customized globally by creating a config file at ~/.config/haj/config.toml. It uses the TOML format.
# ~/.config/haj/config.toml
# default options
[]
= true
= "catppuccin"
= false
= false
= "~/.cache/haj/aur"
= "vimdiff"
= false
more config options are currently under work
for nerds
haj is built with a focus on memory safety, zero-cost abstractions, and concurrent execution.
-
asynchronous pty parsing: uses
tokioto spawn non-blocking pseudo-terminals, capturing and formattingpacman's c-level standard streams in real-time without deadlocking background workers. -
ffi & memory safety: utilizes
alpm.rsto interface with arch linux'slibalpm. database locks are explicitly managed and safely dropped from memory before handing state mutation over to external processes. -
dag traversal: the
orphandetection engine completely avoids bash scripting, instead traversing the system's directed acyclic graph (dag) directly in memory via c-bindings to calculate unneeded dependencies in microseconds. -
lazy-loaded virtual ui: the tui package browser aggressively caches asynchronous metadata and virtualizes list rendering. this guarantees that scrolling through huge aur databases or rendering massive file trees runs at a flawless 60 fps without ever blocking the main thread.
-
fully asynchronous tui: background workers fetch package metadata, dependency trees and installed file lists while the ui remains responsive, ensuring navigation never blocks on slow pacman queries.
license (BORING)
GPL-2.0-only license. see LICENSE for more information.
made with rust, libalpm, and an unreasonable amount of love for the ikea shark.
haj loves you all :3