pkg
Synopsis
Section titled “Synopsis”pkg [-h] [-i|-u] <package> [package...]Description
Section titled “Description”Installs or removes packages using the system’s available package manager. Supports paru, yay, pacman, apt, dnf, zypper, yum, brew, and pkg. In auto mode (no flag), detects whether each package is installed and toggles it — installing if absent, removing if present.
The package-installed check uses the correct query for each manager:
pacman``/paru/yay pacman -Qi apt dpkg -s dnf``/zypper/yum rpm -q brew brew list pkg pkg info
Arguments
Section titled “Arguments”-h, --help |
Show help message |
-i, --install |
Force install mode |
-u, --uninstall |
Force uninstall mode |
package |
One or more package names to install or remove |
Exit Status
Section titled “Exit Status”0 |
Operation completed |
1 |
No supported package manager found, unknown flag, or package operation failed |
Example
Section titled “Example”pkg firefoxpkg -i ripgrep fd-findpkg -u cowsayDependencies: _fish_deps_detect_pm, pacman, paru, yay
Classification: network