PHPackages                             janpecha/composer-run - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. janpecha/composer-run

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

janpecha/composer-run
=====================

Run commands from Composer packages locally, without global installation.

v1.0.0(7mo ago)018BSD-3-ClausePHPPHP 8.4 - 8.5CI passing

Since Nov 10Pushed 7mo agoCompare

[ Source](https://github.com/janpecha/composer-run)[ Packagist](https://packagist.org/packages/janpecha/composer-run)[ Fund](https://www.janpecha.cz/donate/)[ RSS](/packages/janpecha-composer-run/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Composer Run
============

[](#composer-run)

[![Build Status](https://github.com/janpecha/composer-run/workflows/Build/badge.svg)](https://github.com/janpecha/composer-run/actions)[![Downloads this Month](https://camo.githubusercontent.com/a1c77c571dd44a5d5ab0f769248171cd0595817149e5c5fce65b9a768ca83b60/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6a616e70656368612f636f6d706f7365722d72756e2e737667)](https://packagist.org/packages/janpecha/composer-run)[![Latest Stable Version](https://camo.githubusercontent.com/5927e5fdb954b8230e2c525646caadb6cc242aece05e2903380f5e4f3a1efbb5/68747470733a2f2f706f7365722e707567782e6f72672f6a616e70656368612f636f6d706f7365722d72756e2f762f737461626c65)](https://github.com/janpecha/composer-run/releases)[![License](https://camo.githubusercontent.com/fa7d5fcf2c84b580327af52da95dd751703af65f079dc3c5a0081beac0789718/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4e65772532304253442d626c75652e737667)](https://github.com/janpecha/composer-run/blob/master/license.md)

Run commands from Composer packages locally, without global installation.

[![Donate](https://camo.githubusercontent.com/101b981194f1dafbf9c42e19c3034fe2d724e75be972cef0f4477074997834db/68747470733a2f2f6275796d65636f666665652e696e746d2e6f72672f696d672f646f6e6174652d62616e6e65722e76312e737667)](https://www.janpecha.cz/donate/)

Installation
------------

[](#installation)

[Download a latest package](https://github.com/janpecha/composer-run/releases) or use [Composer](http://getcomposer.org/):

```
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.

Manual installation
-------------------

[](#manual-installation)

- clone repository
- run `composer install`
- create symlink to file `composer-run` in `~./local/bin`

Usage
-----

[](#usage)

```
composer-run
composer-run

```

### Run binary from one package

[](#run-binary-from-one-package)

```
composer-run phpstan/phpstan phpstan analyse

```

Installs `phpstan/phpstan` and runs `vendor/bin/phpstan analyse`.

### Run binary from multiple packages

[](#run-binary-from-multiple-packages)

```
composer-run phpstan/phpstan phpstan/extension-installer phpstan analyse

```

Installs `phpstan/phpstan` and `phpstan/extension-installer` and runs `vendor/bin/phpstan analyse`.

### Run binary from multiple packages with extra packages from `composer.json`

[](#run-binary-from-multiple-packages-with-extra-packages-from-composerjson)

`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.

### Run binary from popular tools

[](#run-binary-from-popular-tools)

#### PHPStan

[](#phpstan)

```
composer-run phpstan

```

Installs `phpstan/phpstan`, `phpstan/extension-installer` and `extra:phpstan-extensions`, runs `vendor/bin/phpstan ` binary.

Commands
--------

[](#commands)

### help

[](#help)

```
composer-run help

```

Prints help.

### clean

[](#clean)

```
composer-run clean

```

Remove installations older than ``.

Default number of days is *30*.

Configuration
-------------

[](#configuration)

Create configuration file `.config.php` in Composer-Run directory.

```
