eshimischi / vendor-cleanup
Global CLI tool & Composer plugin to strip tests, docs, and dev files from vendor in production
Package info
github.com/eshimischi/vendor-cleanup
Type:composer-plugin
pkg:composer/eshimischi/vendor-cleanup
Requires
- php: ^8.5
- composer-plugin-api: ^2.6
Requires (Dev)
- composer/composer: ^2.11
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Global CLI utility and Composer plugin to strip tests, documentation, CI configs, and other non-production files from your vendor directory.
Installation
Global installation (recommended)
composer global config --no-plugins allow-plugins.eshimischi/vendor-cleanup true
composer global require eshimischi/vendor-cleanup
Make sure Composer's global bin directory (composer global config bin-dir --absolute) is in your system $PATH.
Project installation
composer config --no-plugins allow-plugins.eshimischi/vendor-cleanup true
composer require eshimischi/vendor-cleanup
Usage
1. Automatic mode (Composer Plugin)
When installed globally or locally, the plugin automatically cleans vendor after composer install --no-dev or composer update --no-dev. In dev mode (--dev), automatic cleanup is skipped so your local test suites stay intact.
You can customize patterns or disable auto-run in your project's composer.json:
{
"extra": {
"vendor-cleanup": {
"auto": true,
"include": ["*.zip", "*.rar"],
"exclude": ["doc", "docs"]
}
}
}
2. Manual CLI mode
Run cleanup inside any Composer project directory:
# Preview what will be deleted (dry run) cleanup --dry # Clean vendor with verbose output cleanup -v # Clean only a specific vendor subdirectory with custom patterns cleanup -v --path symfony --include "*.zip,*.rar" --exclude "doc,docs,test"
Options
| Flag | Description |
|---|---|
-h, --help |
Display help message |
-i, --include |
Add comma-separated glob patterns |
-e, --exclude |
Remove comma-separated patterns from defaults |
-p, --path |
Target a specific subdirectory inside vendor |
-d, --dry |
Run without deleting any files |
-v, --verbose |
Print every matched path |