Even in Node.js and frontend projects, development scripts and CI jobs often rely on CLI tools that are not npm packages, such as gh, jq, and ripgrep. These tools tend to be managed twice: locally through a separate tool like Homebrew or mise, and in CI through a dedicated GitHub Action or shell script.
pnpm, the JavaScript package manager, added the
aqua: protocol in pnpm 12.26.0, released on December 2, 2026. With this feature, pnpm fetches CLI tools from the binaries and archives their publishers release, and you can manage them in
package.json devDependencies and pnpm-lock.yaml just like any other dependency.
In this article, I use pnpm 12.26.0 to add gh and jq to devDependencies and walk through how to run and manage them.
What is the aqua: protocol?
The aqua: protocol downloads and installs CLI tools directly from their publishers' releases, based on the definitions in the aqua registry (
aquaproj/aqua-registry) maintained by the aqua project. For each tool, the aqua registry has a YAML file that describes "which GitHub repository's releases contain archives or binaries for which OS and CPU, and which file is the executable command."
For example, the definition for gh (pkgs/cli/cli/registry.yaml) looks like this:
packages:
- type: github_release
repo_owner: cli
repo_name: cli
files:
- name: gh
src: gh_{{trimV .Version}}_{{.OS}}_{{.Arch}}/bin/gh
version_constraint: "false"
version_overrides:
# Definitions for older versions and fields such as checksum are omitted
- version_constraint: "true"
asset: gh_{{trimV .Version}}_{{.OS}}_{{.Arch}}.{{.Format}}
format: zip
overrides:
- goos: linux
format: tar.gz
- goos: windows
files:
- name: gh
src: bin/gh.exe
replacements:
darwin: macOSThis YAML defines the following rules:
type,repo_owner,repo_name: Specify the source GitHub repository and the distribution channel (GitHub Releases)asset,format,replacements: Build the asset name template from the version, OS, and CPU (e.g.gh_2.106.0_macOS_arm64.zip), mapping OS names that the release spells differently, such asdarwin, tomacOSoverrides: Override per-OS differences. Here, the format for Linux is switched totar.gz, and the executable path for Windows is switched tobin/gh.exefiles: Define which file in the archive is linked under which command name (gh)
Because pnpm reads this definition and fetches the executable from the publisher's release, you can add tools to a project without going through a wrapper package on npm. In package.json, you write them like this:
{
"devDependencies": {
"gh": "aqua:cli/cli@^2.106.0",
"jq": "aqua:jqlang/jq@^1.8.2"
}
}Each entry takes the form "<alias>": "aqua:<name>@<selector>". The parts mean the following:
<name>: The tool's name in the aqua registry (usually in the form<owner>/<repository>)<selector>: A SemVer range, an exact version, or a release tag (if omitted, the latest stable release is chosen)<alias>: The dependency name inpackage.json(if omitted withpnpm add, the last segment of<name>is used)
Tools added with the aqua: protocol can only be placed in devDependencies. Declaring them in dependencies, optionalDependencies, peerDependencies, or in the package.json of a dependency causes an error at install time. These three fields of a published package are also read by npm, Yarn, and other package managers that do not understand aqua:, so the design limits tools to the project's own development dependencies.
Adding gh and jq to devDependencies
Starting from an empty project, add gh and jq with pnpm add. Because aqua: tools are treated as development dependencies, they are written to devDependencies automatically even if you omit -D (--save-dev).
pnpm add gh@aqua:cli/cli aqua:jqlang/jqOnly gh has an explicit alias, gh@. When the alias is omitted, the last segment of <name> becomes the dependency name, so aqua:jqlang/jq is registered as jq, while aqua:cli/cli would be registered as cli.
Operations that update the lockfile, such as pnpm add and pnpm update, call GitHub's releases API. Unauthenticated requests are limited to 60 per hour, and exceeding the limit fails with ERR_PNPM_GITHUB_API_RATE_LIMIT. Setting a GitHub personal access token in the GITHUB_TOKEN environment variable authenticates the requests and raises the limit to 5,000 per hour.
Running the command above with pnpm 12.26.0 downloaded and installed the tools as follows:
Progress: resolved 2, reused 0, downloaded 2, added 1
Packages: +2 (100% downloaded)
↓↓
devDependencies:
+ gh <- cli 2.106.0
+ jq 1.8.2
Done in 4.5s using pnpm v12.26.0The line + gh <- cli 2.106.0 shows that cli, the last segment of cli/cli, was registered under the alias gh. After running the command, package.json looks like this:
{
"name": "pnpm-aqua-protocol-dev-dependencies",
"private": true,
"devDependencies": {
"gh": "aqua:cli/cli@^2.106.0",
"jq": "aqua:jqlang/jq@^1.8.2"
}
}If you try to add a tool to dependencies with --save-prod, pnpm rejects it with ERR_PNPM_TOOL_OUTSIDE_DEV_DEPENDENCIES:
pnpm add --save-prod aqua:jqlang/jqError: ERR_PNPM_TOOL_OUTSIDE_DEV_DEPENDENCIES
× adding a new package
╰─▶ jq is an aqua tool, which can only be a development dependency
help: Add it without --save-prod, --save-optional or --save-peer. A package's consumers would install any other group, and npm and Yarn do not know the aqua: protocol.--save-optional and --save-peer produce the same error.
How pnpm-lock.yaml and node_modules/.bin behave
When pnpm add or pnpm update resolves an aqua: tool, pnpm consults the aqua registry definition and the GitHub API (release information) to determine, for each OS and CPU, the download URL of the archive or binary, its format, the path of the executable, and its SHA-256 checksum. It then writes them to the importers, packages, and snapshots sections of pnpm-lock.yaml. This lets development machines on different OSes and CI reproduce the same untampered binaries, and installs from the lockfile do not need to query the aqua registry or the GitHub API again.
Let's look at the key parts of the generated pnpm-lock.yaml.
importers:
.:
devDependencies:
gh:
specifier: aqua:cli/cli@^2.106.0
version: cli@aqua:cli/[email protected]
jq:
specifier: aqua:jqlang/jq@^1.8.2
version: aqua:jqlang/[email protected]
packages:
cli@aqua:cli/[email protected]:
resolution:
type: variations
variants:
- resolution:
archive: tarball
bin:
gh: bin/gh
integrity: sha256-pHZEn6liVBPFSjc07e1i6eSA5J9CH/COfzs4ecBZoDM=
type: binary
url: https://github.com/cli/cli/releases/download/v2.106.0/gh_2.106.0_linux_amd64.tar.gz
targets:
- cpu: x64
os: linux
- cpu: x64
os: linux
libc: musl
- resolution:
archive: zip
bin:
gh: gh_2.106.0_macOS_arm64/bin/gh
integrity: sha256-IrK3I9+8abYCKxsIYE/1HA21qotndLTO0aR7hBOpldY=
type: binary
url: https://github.com/cli/cli/releases/download/v2.106.0/gh_2.106.0_macOS_arm64.zip
targets:
- cpu: arm64
os: darwin
# Variants for linux/arm64, darwin/x64, win32/x64, and win32/arm64 follow
version: 2.106.0
hasBin: true
jq@aqua:jqlang/[email protected]:
resolution:
type: variations
variants:
- resolution:
archive: file
bin:
jq: jq
integrity: sha256-LXU0C6V6S0tMhwiiHC3I6VikiqqLuhOyf3f25MDsoH4=
type: binary
url: https://github.com/jqlang/jq/releases/download/jq-1.8.2/jq-macos-arm64
targets:
- cpu: arm64
os: darwin
# Variants for linux/x64, linux/arm64, darwin/x64, and win32/x64 and arm64 follow
version: 1.8.2
hasBin: trueThis lockfile has the following characteristics:
- As in
cli@aqua:cli/[email protected]andjq@aqua:jqlang/[email protected], the package-name position holds the last segment of the registry name, and the version position is qualified asaqua:<registry name>@<version>. pnpm uses the package name as a directory name and validates it against npm's package name rules, so a registry name containing a slash, likecli/cli, cannot be used as the package name. Instead, as with the URL of a git dependency, the registry name is carried on the version side. Because the key does not depend on the alias, referencing the same tool under different aliases shares one entry, and no key can be mistaken for an npm package's - For
gh, the Linux variants are recorded asarchive: tarballand the macOS and Windows variants asarchive: zip, withbin/ghorgh_2.106.0_macOS_arm64/bin/ghinside the archive mapped to theghcommand.jq, on the other hand, is distributed as a standalone binary rather than a compressed archive, so it is recorded asarchive: file - Each platform's download URL is pinned with
integrity: sha256-.... Even when you runpnpm addon macOS, the URLs and checksums for Linux and Windows are recorded as well, so other OSes and CI environments can install from the same lockfile as is
pnpm install --frozen-lockfile, which installs from the lockfile, skips the resolution step and does not contact the aqua registry or the GitHub API. On a fresh environment with no cache, pnpm downloads only the binaries from the URLs in the lockfile and verifies their hashes; if the pnpm store already has them cached, it can restore them entirely offline. When I copied only package.json and pnpm-lock.yaml to another directory and reinstalled with --offline, it finished in 126ms from the store cache.
pnpm install --frozen-lockfile --offline✓ Lockfile passes supply-chain policies
· Lockfile is up to date, resolution step is skipped
Progress: resolved 2, reused 2, downloaded 0, added 0
Packages: +2 (100% reused)
++
Done in 126ms using pnpm v12.26.0Looking at node_modules/.bin after the install, both gh and jq are there as executables that invoke the binaries in the virtual store.
ls -la node_modules/.bin-rwxr-xr-x@ 1 user staff 3844 Dec 6 11:28 gh
-rwxr-xr-x@ 1 user staff 3780 Dec 6 11:28 jqControlling target platforms with supportedArchitectures
By default, every OS and CPU a tool is distributed for is recorded in pnpm-lock.yaml. In team development and CI, however, this can cause two problems:
- For assets whose digest the GitHub API does not report, pnpm downloads the file for each OS it locks and computes the hash itself. If OSes your project never uses are included, fetching those unnecessary binaries costs time and bandwidth
- If you
pnpm adda tool on one OS when it does not ship binaries for another OS, the add succeeds, and the error only surfaces later when a teammate on the unsupported OS or CI runspnpm install --frozen-lockfile
pnpm 12.26.0 lets you specify supportedArchitectures as three separate lists, resolve, fetch, and required, to address these problems.
supportedArchitectures:
resolve: [darwin-arm64, linux-x64, win32-x64]
fetch: [current]
required: [darwin-arm64, linux-x64]Each key does the following:
resolve: Limits the range of platforms recorded inpnpm-lock.yaml, avoiding hashing and locking for OSes you don't needfetch: Selects what gets downloaded to the local environment (default:[current])required: Specifies the platforms your team or CI must support. If anaqua:tool has no asset for a listed platform, dependency resolution such aspnpm addfails with an error
When I actually removed the current environment from resolve, I got the following error:
Error: ERR_PNPM_UNSUPPORTED_PLATFORM
╰─▶ supportedArchitectures.fetch target current (darwin-arm64) is outside supportedArchitectures.resolveRunning tools with pnpm exec and scripts
Tools linked into node_modules/.bin can be invoked with pnpm exec or from scripts in package.json, just like the CLI of a regular npm package.
First, add scripts that run gh and jq to package.json.
{
"name": "pnpm-aqua-protocol-dev-dependencies",
"private": true,
"scripts": {
"gh:version": "gh --version",
"jq:name": "jq -r .name package.json"
},
"devDependencies": {
"gh": "aqua:cli/cli@^2.106.0",
"jq": "aqua:jqlang/jq@^1.8.2"
}
}When you run these scripts or pnpm exec, the versions pinned in devDependencies are launched, regardless of whether gh or jq is also installed locally through Homebrew or similar.
pnpm run gh:version$ gh --version
gh version 2.106.0 (2026-11-25)
https://github.com/cli/cli/releases/tag/v2.106.0pnpm run jq:name$ jq -r .name package.json
pnpm-aqua-protocol-dev-dependenciespnpm exec jq --versionjq-1.8.2As with regular dependencies, pnpm outdated, pnpm update, pnpm remove, and pnpm why all work as usual.
Running a tool once with pnx without adding it as a dependency
If you want to run a tool just once without adding it to the project's package.json, use pnx.
pnx aqua:jqlang/jq --versionPackages: +1 (100% reused)
+
devDependencies:
+ jq 1.8.2
jq-1.8.2
Done in 1.3s using pnpm v12.26.0If the same version is already cached in pnpm's content-addressable store, it is reused without being downloaded again.
Summary
- With the
aqua:protocol in pnpm 12.26.0, you can fetch CLI tools registered in the aqua registry, such asghandjq, from their publishers' releases and manage them asdevDependencies pnpm add gh@aqua:cli/cli aqua:jqlang/jqadds tools todevDependencieseven without-D, while--save-prodor declaring them independenciesfails withERR_PNPM_TOOL_OUTSIDE_DEV_DEPENDENCIESpnpm-lock.yamlrecords the download URL and SHA-256 checksum for each OS and CPU asvariations, and installs with--frozen-lockfiledo not contact the GitHub API or the aqua registry- Installed tools are linked into
node_modules/.bin, so you can run them withpnpm execor fromscriptsinpackage.jsonjust like regular npm tools, and usepnxfor one-off runs - Use the
resolve,fetch, andrequiredlists ofsupportedArchitecturesto control which platforms are locked and which are required
References
Supported package sources - Tools from their publishers | pnpm
Dependency resolution settings - supportedArchitectures | pnpm
Release pnpm 12.26 (v12.26.0) · pnpm/pnpm
PR #18587: feat: install command-line tools from their publishers' releases · pnpm/pnpm
PR #18593: feat: configure platforms for resolution and fetching · pnpm/pnpm
aquaproj/aqua-registry




