This package is a CLI for working with the pkglist format.
The CLI provides the following commands:
-
parse
parses a pkglist file and returns the packages installable by the selected package manager, -
get-script
returns an install script for the selected package manager.
The parse
command is used to get all package entries, with the selected prefix, from a pkglist:
# from a file
pkglist parse -p apt ./main.pkglist
# from STDIN
cat ./main.pkglist | pkglist parse -p apt
The get-script
command is used to get a script that may be used to invoke the selected package manager:
pkglist get-script -p apt
The script returned by get-script
is non-prescriptive; you're welcome to alter it however you want, or to provide your own.
The parse
and get-script
commands can be piped together as follows:
export PREFIX="apt"
pkglist parse -SUp $PREFIX ./main.pkglist | xargs $(pkglist get-script -p $PREFIX)
Supported prefixes are:
-
apt
, for APT. -
apt-repo
, for APT repositories. -
flatpak
, for Flatpak. -
snap
, for Snap (using the default install mode). -
snap-classic
, for Snap (using the classic install mode).
pkglist <command>
Commands:
pkglist parse [file] Parse a pkglist file for the selected package manager.
pkglist get-script Get a script to invoke the selected package manager's
install command.
Options:
--help Show help [boolean]
--version Show version number [boolean]
pkglist parse [file]
Parse a pkglist file for the selected package manager.
Positionals:
file Filepath to a pkglist file. Or "-", to read from stdin.
[string] [default: "-"]
Options:
--help Show help [boolean]
-p, --prefix Which prefix should be selected?. [string] [required]
-S, --sort Sort output. [boolean] [default: false]
-U, --uniq, --unique Make output unique. [boolean] [default: false]
pkglist get-script
Get a script to invoke the selected package manager's install command.
Options:
--help Show help [boolean]
-p, --prefix Which prefix should be selected? [string] [required]
-y, --yes Reduce the need for user input by answering yes to any questions
, or by using a non-interactive mode, if available.
[boolean] [default: false]
-s, --sudo Prefix the output script with "sudo" [boolean] [default: false]
The pkglist specification and this program were both created by @jamescallumyoung.
Contributions to this project are welcome.
© 2024 by James Young and licensed under Apache-2.0.