Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Run commands from Composer packages locally, without global installation.

License

Notifications You must be signed in to change notification settings

janpecha/composer-run

Open more actions menu

Repository files navigation

Composer Run

Build Status Downloads this Month Latest Stable Version License

Run commands from Composer packages locally, without global installation.

Donate

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.

Manual installation

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

Usage

composer-run <command>
composer-run <package> <binary-name> <arguments>

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

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

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

PHPStan

composer-run phpstan <arguments>

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

Commands

help

composer-run help

Prints help.

clean

composer-run clean <days>

Remove installations older than <days>.

Default number of days is 30.

Configuration

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

<?php

return [
	// my configuration
	'tempDirectory' => '/path/to/temp',
];

composerExecutable

Name of Composer executable file (or path to executable file).

Default composer.

tempDirectory

Path to temp directory for package installations.

Default <Composer-Run directory>/.tmp.


License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/

About

Run commands from Composer packages locally, without global installation.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.