Skip to content
Latchkey

pnpm dlx: Run Packages Temporarily

pnpm dlx runs a package without installing it into your project.

dlx is ideal for generators and one-shot tools; pin versions so CI stays reproducible.

Common usage

  • pnpm dlx <pkg> [args]
  • pin: pnpm dlx <pkg>@<version>
  • --package to disambiguate the bin

Example in CI

Run a one-off codemod.

shell
pnpm dlx jscodeshift@0.15 -t transform.js src

In CI

Unpinned dlx resolves to latest at runtime. Pin or add as a devDependency for repeatable builds.

Key takeaways

  • pnpm dlx is pnpm’s npx.
  • Pin versions in CI.
  • Frequent tools belong in devDependencies.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →