knott
knott is a fast Rust Arch Linux package helper for pacman repositories and the AUR. It combines repo/AUR search, provider-aware AUR planning, and upfront install menus.
Current Features
- Pacman-like CLI defaults:
knottruns-Syu, bare terms open a search menu. - Combined repo/AUR search with AUR narrowing by the shortest term first.
- AUR RPC client with keep-alive, gzip, batching, request timeouts, and per-run caches.
- AUR package info, PKGBUILD printing, and PKGBUILD clone/update support.
- AUR install dry-run/planning with dependency graph ordering and provider lookup.
- Local pacman DB parser for installed markers and AUR update checks.
- Arch-like version comparison for local-vs-AUR upgrade detection.
- Numeric menu parser supporting
1 2,1-3,^4, and package names. - Sanitized terminal output for package metadata, errors, and dry-run commands.
- Aisling-powered tqdm progress loaders for batched AUR metadata fetches.
- Release profile tuned for optimized binaries: LTO, one codegen unit, stripped binary.
Installation
Install the published crate from crates.io:
# or pin it explicitly:
If the crates.io index has not picked up the latest release yet, use the exact version above or retry after the index updates.
Build
Commands
Resource Limits
- AUR info RPC requests are batched in chunks of 150 package names.
- AUR info cache is capped at 4096 packages per process.
- AUR search cache is capped at 128 search entries per process.
- Search result sets larger than 2048 packages are returned but not cached.
- PKGBUILD responses are capped at 1 MiB.
- AUR dependency resolution is capped at 4096 packages per graph.
- Local pacman
descfiles are read with a 1 MiB per-file limit. - knott does not spawn background Tokio tasks or use channels; child processes are awaited directly.
Use knott --diagnostics to print the active limits and current RSS where the
platform exposes it.
Output Safety
- Package metadata, search results, info output, status lines, errors, warnings, prompts, and dry-run command echoes go through sanitized output helpers before printing to a terminal.
- Sanitization strips ANSI escape sequences and control characters while keeping normal Unicode text, tabs, and line breaks where appropriate.
knott -Gpprints raw PKGBUILD data intentionally so it remains suitable for redirection and inspection.- Progress loaders use
aisling'stqdmloader on stderr only when stderr is a TTY.--quiet,--no-progress, orKNOTT_PROGRESS=0disable them.
Environment
KNOTT_AUR_URL: AUR base URL, defaults tohttps://aur.archlinux.org.KNOTT_BUILDDIR: AUR build cache, defaults to$XDG_CACHE_HOME/knott/build.KNOTT_PACMAN: pacman executable, defaults topacman.KNOTT_MAKEPKG: makepkg executable, defaults tomakepkg.KNOTT_GIT: git executable, defaults togit.KNOTT_SUDO: privilege escalation command, defaults tosudo.KNOTT_PROGRESS: set to0,false, oroffto disable progress loaders.
Verification
Maintenance
- Bump the patch version for every project change, and keep
Cargo.toml,Cargo.lock, and README install examples on the same version. - Keep
README.md,knott --helpoutput insrc/cli.rs, and CLI parser tests synced whenever commands or options change. - Keep all caches, dependency graphs, and file reads bounded; update the
Resource Limitssection andknott --diagnosticsoutput when limits change. - Before publishing, verify the package and install path: