The entire PHP 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>
|
Don't worry about different tools for different projects
When you switch between lots of projects, you might find they don't always use the same tooling, so the commands you run are different for each one.
cpx provides commands that will detect the tools the current project is using, and use the correct one for you.
cpx test
cpx check
cpx analyze
) will run static analysis on your project, whether that's PHPStan, Psalm, Phan or something else.cpx format
cpx fmt
) will format your project's code according to the defined styles, using a tool like PHP-CS-Fixer, Laravel Pint, PHPCBF or something else.|
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 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?
composer_require('vendor/package')
in your scratch file to dynamically include packages for testing purposes.
Made with for the PHP community by Liam Hammett