PURL-TOOL(1p)
πΈ NAME πΈ
okay bestie, meet purl-tool β literally just the Package URL tool. that's the whole name, she's simple π
this is the user-contributed Perl documentation for her, so you're in exactly the right place π«Ά
β¨ SYNOPSIS β¨
so here's how you actually call her:
purl-tool [OPTIONS]...STRING
purl-tool --type STRING [--namespace STRING] --name STRING [--version STRING] [--subpath STRING] [--qualifier KEY=VALUE [...]]
^ that's "hand me a string and I'll deal with it" mode, and "build me one from scratch" mode. then there's the classic:
purl-tool [--help|--man|-v]
because sometimes you just need help, the whole manual, or the version number. no cap.
π Options
--info TYPEβ shows you the deets on the PURL type you name. like, information about provided PURL type. obsessed--listβ dumps out the known PURL type(s) it has.--helpβ the brief help message. quick, cute, to the point.--manβ the full documentation. the whole novel.-vβ prints the version, that's it, that's the tweet.-q,--quietβ shhh π€« suppress output.
π "purl" string encode options
these are the ones that build a PURL for you:
--type=STRINGβ the Type.--namespace=STRINGβ the Namespace (optional, bestie, it says so right there).--name=STRINGβ the Name.--version=STRINGβ the Version (optional).--qualifier KEY=VALUEβ a Qualifier key-value (optional).
π¦ "purl" string decode options
these take a PURL and hand stuff back to you:
--download-urlβ gives you the Download URL.--repository-urlβ gives you the Repository URL.-0,--nullβ returns a NULL char instead of a new line. iconic for scripting, fr fr.--format=FORMATβ sets the Output format.--dumperβData::Dumperformat (same thing as--format=dumper).--jsonβ JSON output format (same thing as--format=json).--yamlβ YAML output format (same thing as--format=yaml).--envβ ENV output format (same thing as--format=env).
π«Ά "purl" validation options
--validateβ validates a PURL string and returns the exit code. so you can straight upifon it. main character behaviour, honestly.
β Examples from the synopsis
parse the given Package URL string and return JSON, then send the STDOUT to jq:
purl-tool pkg:cpan/GDT/URI-PackageURL@2.24 --json | jq
download the package from the repository using the PURL string:
wget $(purl-tool pkg:cpan/GDT/URI-PackageURL@2.24 --download-url)
create a canonical PURL string:
purl-tool --type cpan \
--namespace GDT \
--name URI-PackageURL \
--version 2.24
validate a PURL string:
if $(purl-tool $PURL_STRING --validate -q); then
echo "PURL string is valid"
else
echo "PURL string is not valid"
fi
display information about the provided PURL type (allowed components, repository, examples, etc.):
purl-tool --info rpm
display all known PURL types:
purl-tool --list
π DESCRIPTION π
purl-tool β Package URL tool. that's it. that's the description.
so. a Package URL (aka a "purl", the nickname is right there) is a URL string used to identify and locate a software package in a mostly universal and uniform way β across programing languages, package managers, packaging conventions, tools, APIs and databases. it's the β¨lingua francaβ¨ of package identity, and honestly? it ate.
the spec lives here, go read it, it's a whole slay: <https://github.com/package-url/purl-spec>
a purl is a URL composed of seven components:
scheme:type/namespace/name@version?qualifiers#subpath
and the components are separated by a specific character, so the parsing is unambiguous β no guessing games, periodt.
here's the definition for each component:
schemeβ the URL scheme, with the constant value ofpkg. one of the primary reasons for this single scheme is to facilitate the future official registration of thepkgscheme for package URLs. Required.typeβ the packagetypeor packageprotocol, like cpan, maven, npm, nuget, gem, pypi, etc. Required.namespaceβ some name prefix, like a Maven groupid, a Docker image owner, a GitHub user or organization. Optional and type-specific.nameβ the name of the package. Required.versionβ the version of the package. Optional.qualifiersβ extra qualifying data for a package, like an OS, architecture, a distro, etc. Optional and type-specific.subpathβ extra subpath within a package, relative to the package root. Optional.
π¦ EXAMPLES π¦
more examples, the full-fat versions this time π
parse the given PURL string and return JSON, send the STDOUT to jq:
purl-tool pkg:cpan/GDT/URI-PackageURL@2.24 --json | jq
download the package from the repository using a Package URL string:
wget $(purl-tool pkg:cpan/GDT/URI-PackageURL@2.24 --download-url)
create a canonical Package URL string:
purl-tool --type cpan \
--namespace GDT \
--name URI-PackageURL \
--version 2.24
display information about the provided PURL type (allowed components, repository, examples, etc.):
purl-tool --info rpm
π AUTHOR π
Giuseppe Di Terlizzi <https://metacpan.org/author/gdt> β the icon, the legend, the whole reason this page exists π«Ά
π COPYRIGHT AND LICENSE π
Copyright Β© 2022-2025 Giuseppe Di Terlizzi <https://metacpan.org/author/gdt>
You may use and distribute this module according to the same terms that Perl is distributed under.
and that's the page, bestie π
the footer says perl v5.40.1, dated 2026-01-31, so now you have the version and the date, no cap π go forth and PURL, you've got this π¦
π¦ where this page comes from
- ubuntu resolute: liburi-packageurl-perl 2.25-1 Β· Artistic-2.0
- ubuntu stonking: liburi-packageurl-perl 2.25-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms