Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

pun x

Run a package's command without installing it.

Run a command from a Composer package without adding it to your project. Also runs as punx.

Usage

pun x <package>[:<version>] [command] [args]
punx laravel new example-app
punx phpstan:^2.1 analyse src
punx squizlabs/php_codesniffer phpcbf src
punx list                 # show installs
punx clean phpstan        # remove installs

Options

Command Description
list Show each install and its version.
clean [package] Remove every install, or one package’s.

Everything after the package goes to its command.

Short names: laravel, pint, envoy, phpstan, psalm, rector, php-cs-fixer, phpcs, phpcbf, phpunit, pest, phpmd.

What happens

  • Installs the package into Pun’s cache, not your project.
  • Uses the newest stable release, and checks for a new one once a day.
  • Picks the command: the first argument, the short name, the only command, or the one named after the package.
  • Runs it in the current folder.
  • Your composer.json, composer.lock and vendor/ stay untouched.

Exit codes

Code Meaning
The command’s The command ran.
0 list or clean finished.
2 The package did not install, or has no command.

Last updated on

Was this page helpful?