The entire ecosystem, always at your fingertips.
|
Thousands of tools in the palm of your hand
cpx lets you invoke a command from any Composer package with ease.
cpx vendor/package
to invoke the command from a package. If a package has more than one command, pass through the command name like cpx vendor/package <command>
|
Made to fit the project you're in
When you switch between lots of projects, they don't all pin the same versions of the same tools — and nobody wants to type friendsofphp/php-cs-fixer
more than once.
cpx uses what your project already has, and lets you name the rest.
cpx pint
runs your project's own vendor/bin/pint
when it's installed, so you get the version your project pins. Otherwise cpx installs and runs an isolated copy. Pass --skip-local
to always use the isolated one.cpx alias
cpx alias friendsofphp/php-cs-fixer
gets you cpx php-cs-fixer
from then on. Review yours with cpx aliases
, drop one with cpx unalias
.cpx installed
cpx update
brings them up to date, and cpx clean
clears out the ones you've stopped reaching for.--no-interaction
, or driven by an AI agent — cpx's own commands answer with a single line of JSON, and package runs stream nothing but the tool's own output. Pass --json
to get it any time.|
Superpowers for running PHP
cpx gives you multiple ways to run PHP code quickly, perfect for running scratch files or quickly running code in your project.
cpx exec <file.php>
will run a plain PHP file.
cpx exec -r <raw php code>
will execute the given PHP code.
cpx exec <gist url>
will download a GitHub gist and run it.
cpx tinker
will open an interactive REPL in the terminal for your project.
But what is it you get from this over just using php
or php -r
or psysh
directly?
cpx_require('vendor/package')
in your scratch file to dynamically include packages for testing purposes.
$app
just work. In a Symfony project you get the booted kernel and container. Pass --no-boot
to skip it.
composer global require cpx/cpx:^2.0
Made with for the PHP community by the Laravel team