Files
pnpm/pnpm11/docs/cli/pnx.md
Zoltan KochanandClaude Opus 5.5 c13953b3bc docs: label shell commands and title file snippets (#16699)
Code blocks that hold only shell commands now use the `sh` language,
and blocks showing a file's contents carry a `title` naming the file,
across the pnpm v12, pnpm v11, and pnpr docs. Bold file-name labels
above code blocks are folded into the titles.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 16:14:37 +02:00

2.5 KiB

id, title
id title
pnx pnx

Aliases: pnpm dlx, pnpx

Fetches a package from the registry without installing it as a dependency, hotloads it, and runs whatever default command binary it exposes.

For example, to use create-vue anywhere to bootstrap a Vue project without needing to install it under another project, you can run:

pnx create-vue my-app

This will fetch create-vue from the registry and run it with the given arguments.

You may also specify which exact version of the package you'd like to use:

pnx create-vue@next my-app

The catalog: protocol is also supported, allowing you to use versions defined in your workspace catalogs:

pnx shx@catalog:

Options

--package <name>

The package to install before running the command.

Example:

pnx --package=@pnpm/meta-updater meta-updater --help
pnx --package=@pnpm/meta-updater@0 meta-updater --help

Multiple packages can be provided for installation:

pnx --package=yo --package=generator-webapp yo webapp --skip-install

--allow-build

Added in: v10.2.0

A list of package names that are allowed to run postinstall scripts during installation.

Example:

pnx --allow-build=esbuild my-bundler bundle

The actual packages executed by dlx are allowed to run postinstall scripts by default. So if in the above example my-bundler has to be built before execution, it will be built.

--shell-mode, -c

Runs the command inside of a shell. Uses /bin/sh on UNIX and \cmd.exe on Windows.

Example:

pnx --package cowsay --package lolcatjs -c 'echo "hi pnpm" | cowsay | lolcatjs'

--silent, -s

Only the output of the executed command is printed.

Security and trust policies

Since v11.0.0, pnx (and its pnpm dlx / pnpx aliases) honors the project-level security and trust policy settings when resolving and fetching the requested package:

This means pnx will refuse to execute freshly published or insufficiently trusted packages the same way a regular pnpm install would.