pnpm 12.26.0: Installing CLI Tools Like jq and gh from the aqua Registry, Split Architectures, and sh Hijack ProtectionNote · digest for December 3
Flat-lay still life of neatly arranged command-line tools and a checksum padlock inside a unified pnpm 12.26.0 organizer.
Note3 sections≈ 4 min

pnpm 12.26.0: Installing CLI Tools Like jq and gh from the aqua Registry, Split Architectures, and sh Hijack Protection

One command—pnpm add gh@aqua:cli/cli—drops the exact GitHub CLI binary into node_modules/.bin and locks its macOS, Linux, and Windows checksums inside pnpm-lock.yaml. No more Homebrew instructions in your README for jq or ripgrep, and no more CI failures from mismatched tool versions. The only catch: the tool must be in the aqua registry and installed under devDependencies. pnpm 12.26.0 pairs that with split architecture lists, a customizable build cache key, and three security fixes.

Native CLI tools via aqua: and lockfile checksums

The aqua registry (aquaproj/aqua-registry) is a YAML catalog mapping CLI tools to official release archives across OSes and CPUs. Previously you needed aqua or mise for this; now pnpm understands the aqua: protocol natively:

# Install GitHub CLI from the aqua registry into devDependencies
pnpm add gh@aqua:cli/cli
# Adds to package.json: "gh": "aqua:cli/cli@^2.106.0"

# Run once without adding to the project
pnx aqua:cli/cli

After pnpm install, the binary is linked into node_modules/.bin and ready for npm scripts. pnpm-lock.yaml records URLs and checksums for every release platform—and if GitHub omits a hash, pnpm downloads the archive to compute it.

Two limits apply: aqua: only works in devDependencies (dev/CI tooling, not production dependencies), and you can no longer name a custom registry aqua since the name is reserved.

Split supportedArchitectures and sideEffectsCache.key

If your team codes on macOS arm64 and Windows x64 while CI runs on Linux x64, pnpm-workspace.yaml now lets you split supportedArchitectures into three lists:

# pnpm-workspace.yaml
supportedArchitectures:
  # Platforms recorded in the shared pnpm-lock.yaml
  resolve: [darwin-arm64, linux-x64, win32-x64]
  # Platforms downloaded locally (defaults to [current])
  fetch: [current]
  # Mandatory platforms for aqua tools
  required: [darwin-arm64, linux-x64]

resolve controls what goes into pnpm-lock.yaml, while fetch limits local downloads. Changing only fetch won't trip --frozen-lockfile in CI. required enforces platform coverage for aqua: tools: if an archive is missing for a required OS, install fails, while optionalDependencies remain optional.

Watch out for a common mistake: putting current inside resolve. That locks the file to your machine alone and breaks installs for teammates. Always use explicit platform tags in resolve, and make sure every item in fetch and required is also listed in resolve (note that pnpm in packageManager still keeps all platforms).

Next to it sits sideEffectsCache.key. sideEffectsCache stores postinstall outputs and native module builds; the new key separates builds for different runtimes like Electron or Nix in one cache:

# pnpm-workspace.yaml
sideEffectsCache:
  key:
    # Environment variables hashed into the cache key
    env:
      - npm_config_runtime
    # Exclude major Node.js version from the cache key
    excludeNodeVersion: true

pnpm hashes variables from key.env (such as npm_config_runtime or NIX_CC) and stores only the hash. Reserved variables (NODE, NODE_OPTIONS, TMPDIR, INIT_CWD, npm_package_*, and registry tokens) are rejected with an error. Be careful with excludeNodeVersion: true: if you don't list your target runtime variable in key.env, builds for different Node.js majors share a cache slot, so a Node-API 10 addon (needing Node.js 22.14 or 23.6) will crash on Node.js 18 or 23.0. This key does not affect pnpm dlx or installing pnpm itself.

Three security patches: /bin/sh, tar, and pnpm view

Even if you don't use aqua:, 12.26.0 is worth the upgrade for three security fixes. First, it blocks shell hijacking in lifecycle scripts (preinstall, install, postinstall): pnpm puts node_modules/.bin at the front of PATH, so a malicious package shipping a sh binary could intercept other packages' scripts. Outside Windows, lifecycle scripts now run via absolute /bin/sh (and /system/bin/sh on Android).

Second, tar extraction now matches npm: if a non-header block sits between two 512-byte zero end-of-archive blocks, pnpm stops reading just like npm does, instead of continuing and unpacking hidden trailing files.

Third, pnpm view strips control and invisible formatting characters from registry metadata so a package can't spoof terminal output. Multi-field summaries collapse newlines and tabs into spaces, while --json stays untouched.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 5