Run commands from Composer packages locally, without global installation.
Download a latest package or use Composer:
composer create-project janpecha/composer-run
Create symlink to composer-run in ~/.local/bin or add directory of Composer-Run to PATH environment variable.
Composer-Run requires PHP 8.4 or later.
- clone repository
- run
composer install - create symlink to file
composer-runin~./local/bin
composer-run <command>
composer-run <package> <binary-name> <arguments>
composer-run phpstan/phpstan phpstan analyse
Installs phpstan/phpstan and runs vendor/bin/phpstan analyse.
composer-run phpstan/phpstan phpstan/extension-installer phpstan analyse
Installs phpstan/phpstan and phpstan/extension-installer and runs vendor/bin/phpstan analyse.
myproject/composer.json
{
"extra": {
"phpstan-extensions": [
"phpstan/phpstan-nette",
"phpstan/phpstan-strict-rules"
]
}
}composer-run phpstan/phpstan phpstan/extension-installer extra:phpstan-extensions -- phpstan analyse
Installs phpstan/phpstan, phpstan/extension-installer and all packages from extra.phpstan-extension section, runs vendor/bin/phpstan analyse binary.
composer-run phpstan <arguments>
Installs phpstan/phpstan, phpstan/extension-installer and extra:phpstan-extensions, runs vendor/bin/phpstan <arguments> binary.
composer-run help
Prints help.
composer-run clean <days>
Remove installations older than <days>.
Default number of days is 30.
Create configuration file .config.php in Composer-Run directory.
<?php
return [
// my configuration
'tempDirectory' => '/path/to/temp',
];Name of Composer executable file (or path to executable file).
Default composer.
Path to temp directory for package installations.
Default <Composer-Run directory>/.tmp.
License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/